Angular 2指令ng的Dart实现产生错误

惠勒

在Angular 2 Beta 0的Dart实现中尝试使用ngFor指令时,会生成以下编译时错误。

Property binding ngForOf not used by any directive on an embedded  template ("[ERROR ->]
<div *ngFor="#item of items">
{{item}}
</div>"):

零件:

library design;

import 'package:angular2/angular2.dart';

@Component(
    selector: 'design-component',
    templateUrl: 'design.html',
    viewProviders: const [CORE_DIRECTIVES]
)
class DesignComponent {
   List<String> items = ["One", "Two", "Three"];
}

模板:

<div *ngFor="#item of items">
   {{item}}
</div>

任何建议或帮助,将不胜感激。

贡特·佐赫鲍尔(GünterZöchbauer)

viewProviders应该是directivesviewProviders用于依赖注入。

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章