0
* ngFor 지시문과 콘텐츠 투영을 결합 할 수 있습니까?각도 2 - ngFor with 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/how-to-repeat-a-piece-of-html-multiple-times-without-any-without-another/37676946 # 37676946 –