File
Metadata
| changeDetection |
ChangeDetectionStrategy.OnPush |
| host |
{ } |
| providers |
{
provide: UserItemService, useExisting: UnitUserItemService,
}
|
| selector |
cx-org-unit-user-create |
| templateUrl |
./unit-user-create.component.html |
|
unitKey$
|
Type : Observable<string>
|
Default value : this.unitService.key$
|
|
|
import { ChangeDetectionStrategy, Component } from '@angular/core';
import { Observable } from 'rxjs';
import { UserItemService } from '../../../../user/services/user-item.service';
import { CurrentUnitService } from '../../../services/current-unit.service';
import { UnitUserItemService } from './unit-user-item.service';
@Component({
selector: 'cx-org-unit-user-create',
templateUrl: './unit-user-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: UserItemService,
useExisting: UnitUserItemService,
},
],
})
export class UnitUserCreateComponent {
unitKey$: Observable<string> = this.unitService.key$;
constructor(protected unitService: CurrentUnitService) {}
}
<cx-org-user-form
[unitKey]="unitKey$ | async"
i18nRoot="orgUnit.users"
></cx-org-user-form>
Legend
Html element with directive