【发布时间】:2015-11-27 19:23:04
【问题描述】:
我正在试验 Angular 2 和 Dart。在this step of the tutorial 的末尾,DisplayComponent 类有一个Component 注释,并带有viewBindings 集:
@Component(selector: 'display', viewBindings: const [FriendsService])// this viewBinding
@View(...)
class DisplayComponent {
...
}
带有 angular2-dart 插件的 Atom 告诉我 viewBindings 已被弃用。这似乎符合the documentation。
我尝试简单地从注释中删除变量,但我得到一个异常说No provider for FriendsService。我应该怎么做?
【问题讨论】:
-
@EricMartinez 这是一个简单的零钱下降吗?所以
@Component(selector: 'display', viewProviders: const [FriendsService])?它有效,但我想确保我做对了。 -
您可以在 2.0.0-alpha.41 (2015-10-13) 版本的 API DEPRECATION 部分看到更改:@Component(viewBindings: ...) -> @Component(viewProviders: ...) 所有版本的文件更改日志都在这里:https://github.com/angular/angular/blob/master/CHANGELOG.md
-
有人介意回答这个问题吗?然后 Corey 可以接受它,并且问题显示为已回答而不是未回答。
标签: dart angular-dart angular