libs/rucken/todo-web/src/lib/entities/statuses/status-select/status-select.component.ts
changeDetection | ChangeDetectionStrategy.OnPush |
selector | status-select |
templateUrl | ./status-select.component.html |
Properties |
Methods |
constructor(modalsService: ModalsService, errorsExtractor: ErrorsExtractor, translateService: TranslateService, dynamicRepository: DynamicRepository, statusesConfig: IRestProviderOptions
|
||||||||||||||||||
Parameters :
|
checkChange |
checkChange(value: any, item: any)
|
Returns :
boolean
|
ngOnInit |
ngOnInit()
|
Returns :
void
|
defaultCreateCreateModal | ||||||
defaultCreateCreateModal(item?: StatusWithProject)
|
||||||
Inherited from
StatusesGridComponent
|
||||||
Defined in
StatusesGridComponent:70
|
||||||
Parameters :
Returns :
any
|
defaultCreateUpdateModal | ||||||
defaultCreateUpdateModal(item?: StatusWithProject)
|
||||||
Inherited from
StatusesGridComponent
|
||||||
Defined in
StatusesGridComponent:82
|
||||||
Parameters :
Returns :
any
|
ngOnInit |
ngOnInit()
|
Inherited from
StatusesGridComponent
|
Defined in
StatusesGridComponent:44
|
Returns :
void
|
onChangeFilter | ||||||
onChangeFilter(filter?: IBaseEntityGridFilter)
|
||||||
Inherited from
StatusesGridComponent
|
||||||
Defined in
StatusesGridComponent:61
|
||||||
Parameters :
Returns :
void
|
nameField |
Type : string
|
Default value : 'name'
|
import { ChangeDetectionStrategy, Component, Inject, Input, OnInit } from '@angular/core';
import { FormControl } from '@angular/forms';
import { TranslateService } from '@ngx-translate/core';
import { ErrorsExtractor, ModalsService } from '@rucken/core';
import { STATUSES_CONFIG_TOKEN, StatusWithProject } from '@rucken/todo-core';
import { DynamicRepository, IRestProviderOptions } from 'ngx-repository';
import { StatusesGridComponent } from '../statuses-grid/statuses-grid.component';
import { BindIoInner } from 'ngx-bind-io';
@BindIoInner()
@Component({
selector: 'status-select',
templateUrl: './status-select.component.html',
changeDetection: ChangeDetectionStrategy.OnPush
})
export class StatusSelectComponent extends StatusesGridComponent implements OnInit {
@Input()
searchField: FormControl = new FormControl();
nameField = 'name';
constructor(
modalsService: ModalsService,
protected errorsExtractor: ErrorsExtractor,
protected translateService: TranslateService,
protected dynamicRepository: DynamicRepository,
@Inject(STATUSES_CONFIG_TOKEN)
protected statusesConfig: IRestProviderOptions<StatusWithProject>
) {
super(modalsService, errorsExtractor, translateService, dynamicRepository, statusesConfig);
}
ngOnInit() {
if (!this.mockedItems) {
this.useRest({
apiUrl: this.apiUrl,
...this.statusesConfig,
paginationMeta: { perPage: 1000 }
});
}
if (this.mockedItems) {
this.useMock({
items: this.mockedItems,
...this.statusesConfig
});
}
}
checkChange(value: any, item: any) {
return item instanceof StatusWithProject;
}
}
<entity-select [bindIO]>
<ng-content></ng-content>
</entity-select>