We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 12fd8b5 commit 84c6c68Copy full SHA for 84c6c68
projects/igniteui-angular/src/lib/directives/template-outlet/template_outlet.directive.ts
@@ -63,10 +63,10 @@ export class IgxTemplateOutletDirective implements OnChanges {
63
}
64
65
private _recreateView() {
66
- const index = this._viewContainerRef.indexOf(this._viewRef);
+ const prevIndex = this._viewRef ? this._viewContainerRef.indexOf(this._viewRef) : -1;
67
// detach old and create new
68
- if (this._viewRef && index !== -1) {
69
- this._viewContainerRef.detach(index);
+ if (prevIndex !== -1) {
+ this._viewContainerRef.detach(prevIndex);
70
71
if (this.igxTemplateOutlet) {
72
this._viewRef = this._viewContainerRef.createEmbeddedView(
0 commit comments