Skip to content

Commit 84c6c68

Browse files
MKirovaMKirova
authored andcommitted
chore(*): Fixing tests.
1 parent 12fd8b5 commit 84c6c68

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

projects/igniteui-angular/src/lib/directives/template-outlet/template_outlet.directive.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,10 @@ export class IgxTemplateOutletDirective implements OnChanges {
6363
}
6464

6565
private _recreateView() {
66-
const index = this._viewContainerRef.indexOf(this._viewRef);
66+
const prevIndex = this._viewRef ? this._viewContainerRef.indexOf(this._viewRef) : -1;
6767
// detach old and create new
68-
if (this._viewRef && index !== -1) {
69-
this._viewContainerRef.detach(index);
68+
if (prevIndex !== -1) {
69+
this._viewContainerRef.detach(prevIndex);
7070
}
7171
if (this.igxTemplateOutlet) {
7272
this._viewRef = this._viewContainerRef.createEmbeddedView(

0 commit comments

Comments
 (0)