0
是否有可能与内容投影* ngFor指令结合?角2 - ngFor与ContentProjection
例如: ...
@Component({
selector: 'test',
template: `
<div>
<ng-content *ngFor="..."></ng-content> // <-- Phantasy example
</div>
`
})
export class TestComponent {
}
...
<test>
<p>Hello World</p>
</test>
...
所以导致编译后的DOM可能看起来像:
<test>
<p>Hello World</p>
<p>Hello World</p>
<p>Hello World</p>
</test>
又见http://stackoverflow.com/questions/37685018/repeating-use-of-ng-content/37685085#37685085,http://stackoverflow.com/questions/ 37676593 /如何对重复-A-计件的-HTML的多倍,而无需-ngfor和 - 不-另一个/ 37676946#37676946 –