I've got a whatsapp-like chat case of many types of messages that are needed to be displayed differently.
Each has its' own component such as TextMessageComponent, FileMessageComponent, etc..
I'd like to be able to ngFor once on my array of messages without having to ngIf over the types.
I've heard ngComponentOutlet might be the solution but found it hard to implement..
Any suggestions, a mini demo or anything you find useful would be highly appreciated!
Having a property on the object should help you
Array object should be as
Ensure that all the components are loaded by using them in the AppModule
LIVE DEMO