Why is Controller deprecated in AngularDart 0.10.0?

倖福魔咒の 提交于 2019-11-28 11:11:49

I haven't really understood this change myself but some information:

https://github.com/angular/angular.dart/issues/919

It seems there is only a top level controller left and otherwise component should be used. This makes also publishAs obsolete.

See also: https://github.com/angular/angular.dart/issues/413

Misko Heverys response about the reasoning behind the decision
(copied from https://github.com/angular/angular.dart/issues/919)

ng-controller have some weird semantics, and always felt like the odd man out. ng-controller is only useful outside of component, and nesting them has issues, so you usually have only one.

Removing it simplifies the world. The issue is that it makes hello world kinds of apps more complicated, but that will be solved by allowing the root of the app to have its own type and one would get best of all worlds.

The issue that everything has to be a component only feels like an issue if the cost of creating them is high. If you have light weight components with decorator-directives then you have all the tools you should need for building your app.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!