angular - How to pass an object from parent component to child component which is created using DCL loadintolocation()? -
i loading component using dcl.i want pass object component.. have made plunker demo http://plnkr.co/edit/qklmnnjfrt8pyvngdjg4?p=preview appcomponent parent , object want pass information = {name:"abhi", place:"banglore"};
export class somecomponent { public childform: controlgroup; constructor(fbs: formbuilder) { this.childform = fbs.group({ 'name': ['', validators.required], 'place':[''] }); } }
this child component...when ever new component loads want display object passed in input box of child component.i have no idea how pass data parent child in dcl...somebody please me guys...
the componentref provides reference created component it's instance
getter
loadintolocation(...).then(ref => { ref.instance.somefield = somevalue; }
see similar question how call event in parent component child component loaded using dcl loadintolocation()
Comments
Post a Comment