由于最近做项目的需要,现在要从头开始学习 Angular 2.
通读很多网站,节选重点
端对端的解决方案
AngularJS试图成为WEB应用中的一种端对端的解决方案。这意味着它不只是你的WEB应用中的一个小部分,而是一个完整的端对端的解决方案。这会让AngularJS在构建一个CRUD(增加Create、查询Retrieve、更新Update、删除Delete)的应用时显得很“固执”(原文为 opinionated,意指没有太多的其他方式)。但是,尽管它很“固执”,它仍然能确保它的“固执”只是在你构建应用的起点,并且你仍能灵活变动。AngularJS的一些出众之处如下:
构建一个CRUD应用可能用到的全部内容包括:数据绑定、基本模板标识符、表单验证、路由、深度链接、组件重用、依赖注入。
测试方面包括:单元测试、端对端测试、模拟和自动化测试框架。
具有目录布局和测试脚本的种子应用作为起点。
Angular 2和Angular 1的区别在于:
In Angular 2, Components are the main way we build and specify elements and logic on the page.
In Angular 1, we achieved this through directives, controllers, and scope. In Angular 2, all those concepts are combined into Components.
COMPONENT
When we use the <my-component></my-component>
tag in our HTML, this component will be created, our constructor called, and rendered.