/
githubmirror
/
angular
Обзор
Документация
Войти
/
githubmirror
/
angular
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
integration/animations/src/app/nested.component.ts
48 строк
1 KB
Jessica Janiuk
feat(core): re-introduce nested leave animations scoped to component boundaries
13 мар 2026, 22:01
13 мар 2026, 22:01
df659b8
Код
Авторство
О чём код?
import {Component, signal, ViewEncapsulation} from '@angular/core'; @Component({ selector: 'app-nested-child', template: `<div class="child-target" animate.leave="child-leave">Child</div>`, styles: [ ` .child-leave { animation: test-leave 800ms; } `, ], encapsulation: ViewEncapsulation.None, }) export class NestedChildComponent {} @Component({ selector: 'app-nested', imports: [NestedChildComponent], template: ` <h2>Nested Animations</h2> @if (show()) { <div class="nested-parent"> <app-nested-child></app-nested-child> </div> } <ng-container> <app-nested-child></app-nested-child> </ng-container> <button id="toggle-nested" (click)="show.set(!show())">Toggle</button> `, styles: [ ` @keyframes test-leave { from { opacity: 1; } to { opacity: 0; } } `, ], encapsulation: ViewEncapsulation.None, }) export class NestedComponent { show = signal(true); }