버튼을 클릭 할 때 스피너 구성 요소를 동적으로로드하려고합니다.elementRef.createComponent가 함수가 아닙니다
Plunker 링크는 여기에 내가 오류가 아래 얻고있다
http://plnkr.co/edit/UEEQQRzX7RIkSO49rCHu?p=preview
let elementRef: ElementRef = this.appRef['_rootComponents'][0].location;
return this.startInside(elementRef, null);
입니다 :
elementRef.createComponent is not a function.
제안하십시오!
문제점하는 것 같다 'this.appRef ['_ rootComponents '] [0] .location' 예상대로'ViewContainerRef'를 반환하지 않습니다. 비슷한 예제에 대한 링크가 포함 된 다른 질문에 대한 링크를 추가 할 수 있습니까? –