/
githubmirror
/
tabby
Обзор
Документация
Войти
/
githubmirror
/
tabby
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
tabby-core/src/components/tabBody.component.ts
37 строк
1 KB
Eugene
bootstrap 5 WIP (#7891)
26 фев 2023, 22:42
Не верифицирован
26 фев 2023, 22:42
1e5cfd1
Код
Авторство
О чём код?
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */ import { Component, Input, ViewChild, HostBinding, ViewContainerRef, OnChanges } from '@angular/core' import { BaseTabComponent } from '../components/baseTab.component' /** @hidden */ @Component({ selector: 'tab-body', template: ` <ng-template #placeholder></ng-template> `, styleUrls: [ './tabBody.component.scss', './tabBody.deep.component.css', ], }) export class TabBodyComponent implements OnChanges { @Input() @HostBinding('class.active') active: boolean @Input() tab: BaseTabComponent @ViewChild('placeholder', { read: ViewContainerRef }) placeholder?: ViewContainerRef ngOnChanges (changes) { if (changes.tab) { this.placeholder?.detach() setImmediate(() => { this.placeholder?.insert(this.tab.hostView) }) } } detach () { this.placeholder?.detach() } ngOnDestroy () { this.placeholder?.detach() } }