2017-04-26 3 views
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> 
+0

도 참조 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 –

답변

0

현재 ng-content가 컴파일 타임에 해결되기 때문에 이것이 현재 지원되지 않는다고 생각합니다. #8563

관련 문제