fix(dynamic_component_loader): check whether the dynamically loaded component has already been destroyed
Fixes #2748 Closes #2767
This commit is contained in:
@ -73,7 +73,9 @@ export class DynamicComponentLoader {
|
||||
|
||||
var dispose = () => {
|
||||
var index = viewContainer.indexOf(hostViewRef);
|
||||
viewContainer.remove(index);
|
||||
if (index !== -1) {
|
||||
viewContainer.remove(index);
|
||||
}
|
||||
};
|
||||
return new ComponentRef(newLocation, component, dispose);
|
||||
});
|
||||
|
Reference in New Issue
Block a user