/
githubmirror
/
ionic
Обзор
Документация
Войти
/
githubmirror
/
ionic
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
packages/angular/test/base/src/app/lazy/modal-dynamic-wrapper/dynamic-component-wrapper.component.ts
26 строк
705 B
Shane
fix(modal): allow sheet modals to skip focus trap (#30689)
24 сен 2025, 22:29
Не верифицирован
24 сен 2025, 22:29
a40d957
Код
Авторство
О чём код?
import { Component, ComponentRef, Input, OnDestroy, OnInit, ViewChild, ViewContainerRef } from "@angular/core"; @Component({ selector: 'app-dynamic-component-wrapper', template: ` <ion-content> <ng-container #container></ng-container> </ion-content> `, standalone: false }) export class DynamicComponentWrapperComponent implements OnInit, OnDestroy { @Input() componentRef?: ComponentRef<unknown>; @ViewChild('container', { read: ViewContainerRef, static: true }) container!: ViewContainerRef; ngOnInit(): void { if (this.componentRef) { this.container.insert(this.componentRef.hostView); } } ngOnDestroy(): void { this.componentRef?.destroy(); } }