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