sass-references/angular-material/material/tree/outlet.ts

28 lines
801 B
TypeScript
Raw Normal View History

2024-12-06 10:42:08 +08:00
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.dev/license
*/
import {CDK_TREE_NODE_OUTLET_NODE, CdkTreeNodeOutlet} from '@angular/cdk/tree';
import {Directive, ViewContainerRef, inject} from '@angular/core';
/**
* Outlet for nested CdkNode. Put `[matTreeNodeOutlet]` on a tag to place children dataNodes
* inside the outlet.
*/
@Directive({
selector: '[matTreeNodeOutlet]',
providers: [
{
provide: CdkTreeNodeOutlet,
useExisting: MatTreeNodeOutlet,
},
],
})
export class MatTreeNodeOutlet implements CdkTreeNodeOutlet {
viewContainer = inject(ViewContainerRef);
_node = inject(CDK_TREE_NODE_OUTLET_NODE, {optional: true});
}