angular - Not able to load component dynamically -


i tried create sample application wanted load component dynamically on button click event parent component. when click on button component not loaded instead getting following error in browser console. please visit plunker application code

zone.js:461unhandled promise rejection: cannot read property 'createcomponent' of undefined ; zone: angular ; task: promise.then ; value: typeerror: cannot read property 'createcomponent' of undefined     @ eval (https://run.plnkr.co/eq3xbfuupwfmtu2c/src/app.ts!transpiled:38:45)     @ zonedelegate.invoke (https://npmcdn.com/zone.js@0.6.12/dist/zone.js:323:29)     @ object.oninvoke (https://npmcdn.com/@angular/core/bundles/core.umd.js:9100:45)     @ zonedelegate.invoke (https://npmcdn.com/zone.js@0.6.12/dist/zone.js:322:35)     @ zone.run (https://npmcdn.com/zone.js@0.6.12/dist/zone.js:216:44)     @ https://npmcdn.com/zone.js@0.6.12/dist/zone.js:571:58     @ zonedelegate.invoketask (https://npmcdn.com/zone.js@0.6.12/dist/zone.js:356:38)     @ object.oninvoketask (https://npmcdn.com/@angular/core/bundles/core.umd.js:9091:45)     @ zonedelegate.invoketask (https://npmcdn.com/zone.js@0.6.12/dist/zone.js:355:43)     @ zone.runtask (https://npmcdn.com/zone.js@0.6.12/dist/zone.js:256:48) 

if query @viewchild(loader, ...) need ensure instantiated. need add loader directives: [...]

  directives: [loader] }) export class app { 

plunker example


Comments

Popular posts from this blog

javascript - Slick Slider width recalculation -

jsf - PrimeFaces Datatable - What is f:facet actually doing? -

angular2 services - Angular 2 RC 4 Http post not firing -