Angular1.x
思路图:
angular1.x抛弃ng-controller和scope继承(上面提到的3个弊端),思路和angular2+的方向一致,用指令来实现组件式开发!
controller as 给scope加上了命名空间(isolate scope):
https://toddmotto.com/digging-into-angulars-controller-as-syntax/
Angular2+
架构图:
参考文章链接:http://teropa.info/blog/2014/10/24/how-ive-improved-my-angular-apps-by-banning-ng-controller.html
https://stackoverflow.com/questions/34569094/what-is-the-angular-equivalent-to-an-angularjs-watch