This commit is contained in:
Eugene Pankov
2021-07-06 21:47:15 +02:00
parent 40209dc60d
commit 403bafe0a2
3 changed files with 5 additions and 7 deletions

View File

@@ -19,15 +19,13 @@ import { BaseTabComponent } from '../components/baseTab.component'
export class TabBodyComponent implements OnChanges {
@Input() @HostBinding('class.active') active: boolean
@Input() tab: BaseTabComponent
@ViewChild('placeholder', { read: ViewContainerRef }) placeholder: ViewContainerRef
@ViewChild('placeholder', { read: ViewContainerRef }) placeholder?: ViewContainerRef
ngOnChanges (changes) {
if (changes.tab) {
if (this.placeholder) {
this.placeholder.detach()
}
this.placeholder?.detach()
setImmediate(() => {
this.placeholder.insert(this.tab.hostView)
this.placeholder?.insert(this.tab.hostView)
})
}
}