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 l
As suggested by Tim,
quoting @tbosch's comment
Angular reuses previously created DOM elements by default
So to avoid this behavior, taken from the comment as well, you can use APP_VIEW_POOL_CAPACITY
and assign it 0
as value.
bootstrap(MyApp, [provide(APP_VIEW_POOL_CAPACITY, {useValue: 0})])
Note that since beta.1 APP_VIEW_POOL_CAPACITY
was removed by #5993 and the DOM is being recreated correctly.