File
Metadata
| changeDetection |
ChangeDetectionStrategy.OnPush |
| host |
{ } |
| providers |
{
provide: CostCenterItemService, useExisting: UnitCostCenterItemService,
}
|
| selector |
cx-org-unit-cost-center-create |
| templateUrl |
./unit-cost-center-create.component.html |
|
unitKey$
|
Type : Observable<string>
|
Default value : this.unitService.key$
|
|
|
import { ChangeDetectionStrategy, Component } from '@angular/core';
import { Observable } from 'rxjs';
import { CostCenterItemService } from '../../../../cost-center/services/cost-center-item.service';
import { CurrentUnitService } from '../../../services/current-unit.service';
import { UnitCostCenterItemService } from './unit-cost-center-item.service';
@Component({
selector: 'cx-org-unit-cost-center-create',
templateUrl: './unit-cost-center-create.component.html',
changeDetection: ChangeDetectionStrategy.OnPush,
host: { class: 'content-wrapper' },
providers: [
// we provide a specific version of the `CostCenterItemService` to
// let the form component work with unit cost centers.
{
provide: CostCenterItemService,
useExisting: UnitCostCenterItemService,
},
],
})
export class UnitCostCenterCreateComponent {
unitKey$: Observable<string> = this.unitService.key$;
constructor(protected unitService: CurrentUnitService) {}
}
<cx-org-cost-center-form [unitKey]="unitKey$ | async"></cx-org-cost-center-form>
Legend
Html element with directive