I want to be able to click a button in order to add a new component. So for example, if Angular 2 was more like Angular 1 I could do:
<button (click)="addComponent()">add</button>
ts:
addComponent():void {
let component = $compile('<component-selector></component-selector>')(scope)
ele.append(component)
}
note: I know similar questions have been asked a few times on here but the answers I have read have been contradictory and mostly reliant upon deprecated code such as DynamicComponentLoader. I can't find anything relevant on the official docs and ideally want to find a standardised way of doing this.