Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
843 views
in Technique[技术] by (71.8m points)

dart - Why is Controller deprecated in AngularDart 0.10.0?

I just upgraded to AngularDart 0.10, renamed my Ngcontrollers to Controller and I am very surprised to see that Controller is marked as deprecated by dart-editor. I have seen that Controller is supposed to disappear in AngularDart 1.0 [1] but why is it already deprecated? Am I supposed to use something else right now?

[1] http://blog.angulardart.org/2014/04/angulardart-0100-ostemad-teleportation.html

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...