File

feature-libs/organization/administration/components/unit/list/unit-list.component.ts

Metadata

changeDetection ChangeDetectionStrategy.OnPush
selector cx-org-unit-list
templateUrl ./unit-list.component.html

Index

Methods

Constructor

constructor(unitTreeService: UnitTreeService)
Parameters :
Name Type Optional
unitTreeService UnitTreeService No

Methods

collapseAll
collapseAll()
Returns : void
expandAll
expandAll()
Returns : void
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
Component
Html element with directive

result-matching ""

    No results matching ""