File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed
projects/igniteui-angular/src/lib/directives/template-outlet Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -111,7 +111,10 @@ export class IgxTemplateOutletDirective implements OnChanges {
111111 // if view exists, but template has been changed and there is a view in the cache with the related template
112112 // then detach old view and insert the stored one with the matching template
113113 // after that update its context.
114- this . _viewContainerRef . detach ( this . _viewContainerRef . indexOf ( this . _viewRef ) ) ;
114+ if ( this . _viewContainerRef . length > 0 ) {
115+ this . _viewContainerRef . detach ( this . _viewContainerRef . indexOf ( this . _viewRef ) ) ;
116+ }
117+
115118 this . _viewRef = cachedView ;
116119 const oldContext = this . _cloneContext ( cachedView . context ) ;
117120 this . _viewContainerRef . insert ( this . _viewRef , 0 ) ;
You can’t perform that action at this time.
0 commit comments