为什么Controller在AngularDart 0.10.0中被弃用? [英] Why is Controller deprecated in AngularDart 0.10.0?

查看:129
本文介绍了为什么Controller在AngularDart 0.10.0中被弃用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚升级到AngularDart 0.10,将我的Ngcontrollers重命名为Controller,我非常惊讶地发现, Controller 被dart-editor标记为已弃用。我看到Controller应该在AngularDart 1.0 [1]中消失,但为什么它已经被弃用了?我现在应该使用别的东西吗?

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

推荐答案

我自己还没有真正理解这个变化,但有些信息:

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

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

似乎只有一个顶层控制器,否则应该使用组件。
这也使 publishAs 过时。

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

另请参阅:https://github.com/angular/angular.dart/issues/413

Misko Heverys对决定背后的原因的回应

(从 https:// github复制而来) com / angular / angular.dart / issues / 919

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


ng-controller有一些奇怪的语义,奇怪的
出来了。 ng-controller仅在组件外部有用,
嵌套它们有问题,因此通常只有一个。

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.

删除它简化了世界。问题是,它使hello
世界各种应用程序更复杂,但这将解决通过
允许应用程序的根有自己的类型,一个会得到
最好的世界。

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.

如果创建它们的成本很高,一切都必须是一个组件的问题只是感觉像一个
问题。如果你有轻量级的
组件与decorator-directives,那么你有所有的工具,你
应该需要构建你的应用程序。

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.

这篇关于为什么Controller在AngularDart 0.10.0中被弃用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆