Error during instantiation of AppComponent!.
There is no component directive at element [object Object]
๋ฒ์ beta.0์์ ์๋ํฉ๋๋ค.
http://plnkr.co/edit/p6w6bBZfkvXIdDabc1vI?p=preview
๋ฒ์ beta.1์์ ๊ณ ์ฅ๋ฌ์ต๋๋ค.
http://plnkr.co/edit/3Gn9ZuyMHUdlRqEmqVF7?p=preview
์ฃผ์ ๋ณ๊ฒฝ ์ฌํญ์ ๋ฐ๋ผ
Component view is not yet created when component constructor is called. -> use onInit lifecycle callback to access the view of a component
๋ฐ๋ผ์ ์ฝ๋๋ฅผ ngOnInit
ํ๋ฉด ์ฌ๋ฐ๋ฅด๊ฒ ์๋ํฉ๋๋ค.
ngOnInit() {
this.dcl.loadIntoLocation(ChildComponent, this.elementRef, 'child');
}
@ericmartinezr ๊ฐ์ฌํฉ๋๋ค.
์ด ๋ฌธ์ ๋ ํ๋์ด ์์ด ์๋์ผ๋ก ์ ๊ฒผ์ต๋๋ค.
์ ์ฌํ๊ฑฐ๋ ๊ด๋ จ๋ ๋ฌธ์ ๊ฐ ๋ฐ์ํ๋ฉด ์ ๋ฌธ์ ๋ฅผ ์ ์ถํ์ญ์์ค.
์๋ ๋ํ ์ ๊ธ ์ ์ฑ ์ ๋ํด ์์ธํ ์์๋ณด์ธ์.
_์ด ์์ ์ ๋ด์ ์ํด ์๋์ผ๋ก ์ํ๋์์ต๋๋ค._
๊ฐ์ฅ ์ ์ฉํ ๋๊ธ
์ฃผ์ ๋ณ๊ฒฝ ์ฌํญ์ ๋ฐ๋ผ
๋ฐ๋ผ์ ์ฝ๋๋ฅผ
ngOnInit
ํ๋ฉด ์ฌ๋ฐ๋ฅด๊ฒ ์๋ํฉ๋๋ค.