I have core component:
export class AppComponent implements OnInit {
constructor() {
const toast: any = {
type: exception.type,
body: ToasterRenderComponent.messages = ["44"],
bodyOutputType: BodyOutputType.Component
};
this.toasterService.pop(toast);
}
}
In constructor I try to fill object toast and assign data to variable of component ToasterRenderComponent:
ToasterRenderComponent.messages = ["44"]
Component ToasterRenderComponent has public property messages, but it does not work for me.
ToasterRenderComponentbody: new ToasterRenderComponent().messages = ["Message1"],ToasterContainerComponent.html:3 ERROR Error: No component factory found for [sfsdfsdsdf]. Did you add it to @NgModule.entryComponents? at noComponentFactoryError...https://www.npmjs.com/package/angular2-toasterAddToast()andclear(). Your toaster should subscribe to the observable, and your other components should use the methods to update the data that should be displayed by your toaster.