File
Metadata
| changeDetection |
ChangeDetectionStrategy.OnPush |
| selector |
cx-org-unit-list |
| templateUrl |
./unit-list.component.html |
Methods
|
collapseAll
|
collapseAll()
|
|
|
|
|
import { ChangeDetectionStrategy, Component } from '@angular/core';
import { UnitTreeService } from '../services/unit-tree.service';
@Component({
selector: 'cx-org-unit-list',
templateUrl: './unit-list.component.html',
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class UnitListComponent {
constructor(protected unitTreeService: UnitTreeService) {}
expandAll() {
this.unitTreeService.expandAll();
}
collapseAll() {
this.unitTreeService.collapseAll();
}
}
<cx-org-list>
<ng-container actions>
<button class="link" (click)="expandAll()">
{{ 'orgUnit.tree.expandAll' | cxTranslate }}
</button>
<button class="link" (click)="collapseAll()">
{{ 'orgUnit.tree.collapseAll' | cxTranslate }}
</button>
</ng-container>
</cx-org-list>
Legend
Html element with directive