libs/rucken/todo-web/src/lib/entities/tasks/task-select/task-select.component.ts
changeDetection | ChangeDetectionStrategy.OnPush |
selector | task-select |
templateUrl | ./task-select.component.html |
Properties |
Methods |
constructor(modalsService: ModalsService, errorsExtractor: ErrorsExtractor, translateService: TranslateService, dynamicRepository: DynamicRepository, tasksConfig: IRestProviderOptions
|
||||||||||||||||||
Parameters :
|
checkChange |
checkChange(value: any, item: any)
|
Returns :
boolean
|
ngOnInit |
ngOnInit()
|
Returns :
void
|
defaultCreateCreateModal | ||||||
defaultCreateCreateModal(item?: Task)
|
||||||
Inherited from
TasksGridComponent
|
||||||
Defined in
TasksGridComponent:80
|
||||||
Parameters :
Returns :
any
|
defaultCreateUpdateModal | ||||||
defaultCreateUpdateModal(item?: Task)
|
||||||
Inherited from
TasksGridComponent
|
||||||
Defined in
TasksGridComponent:92
|
||||||
Parameters :
Returns :
any
|
ngOnInit |
ngOnInit()
|
Inherited from
TasksGridComponent
|
Defined in
TasksGridComponent:45
|
Returns :
void
|
onChangeFilter | ||||||
onChangeFilter(filter?: IBaseEntityGridFilter)
|
||||||
Inherited from
TasksGridComponent
|
||||||
Defined in
TasksGridComponent:69
|
||||||
Parameters :
Returns :
void
|
nameField |
Type : string
|
Default value : 'title'
|
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 { Task, TASKS_CONFIG_TOKEN } from '@rucken/todo-core';
import { DynamicRepository, IRestProviderOptions } from 'ngx-repository';
import { TasksGridComponent } from '../tasks-grid/tasks-grid.component';
import { BindIoInner } from 'ngx-bind-io';
@BindIoInner()
@Component({
selector: 'task-select',
templateUrl: './task-select.component.html',
changeDetection: ChangeDetectionStrategy.OnPush
})
export class TaskSelectComponent extends TasksGridComponent implements OnInit {
@Input()
searchField: FormControl = new FormControl();
nameField = 'title';
constructor(
modalsService: ModalsService,
protected errorsExtractor: ErrorsExtractor,
protected translateService: TranslateService,
protected dynamicRepository: DynamicRepository,
@Inject(TASKS_CONFIG_TOKEN)
protected tasksConfig: IRestProviderOptions<Task>
) {
super(modalsService, errorsExtractor, translateService, dynamicRepository, tasksConfig);
}
ngOnInit() {
if (!this.mockedItems) {
this.useRest({
apiUrl: this.apiUrl,
...this.tasksConfig,
paginationMeta: { perPage: 1000 }
});
}
if (this.mockedItems) {
this.useMock({
items: this.mockedItems,
...this.tasksConfig
});
}
}
checkChange(value: any, item: any) {
return item instanceof Task;
}
}
<entity-select [bindIO]>
<ng-content></ng-content>
</entity-select>