Adding / Removing components on the fly
问题 I need to be able to add & remove Angular components on the fly. To do so, I'm using loadIntoLocation and dispose methods, like it: Adding a component (from a layout manager): this.m_loader.loadIntoLocation(MyComponent, this.m_element, 'content').then(_componentRef => { // Create the window and set its title: var component: MyComponent = (_componentRef.instance); component.ref = _componentRef; // init the component content }); Removing a component (from the component): this.ref.dispose(); It