相关疑难解决方法(0)

Angular2:ngfor如何扩展

我知道教科书的规则<div *ngFor="let foo of foobars">{{foo.stuff}}</div>变成了<template ngFor let-foo="$implicit" [ngForOf]="foobars"><div>...</div></template>.我的问题是双重的:

  • 怎么样?
  • 我自己需要做些什么才能利用这种机制("microsyntax")?

<div *myDirective="item">{{item.stuff}}</div>变成<template myDirective let-item="$implicit"><div>{{item.stuff}}</div></template>

由于我从上到下阅读了ngFor的源代码,我只能假设这个黑魔法在某个地方的编译器中,我一直在角度github上下,但我不能把手指放在它上面.救命!

angular2-template angular

7
推荐指数
1
解决办法
1649
查看次数

标签 统计

angular ×1

angular2-template ×1