Skip to content

Custom selection logic

ng-select allows you to provide a custom selection implementation using SELECTION_MODEL_FACTORY. To override the default logic, provide your factory method in your Angular module or application providers:

// app.config.ts / app.module.ts
providers: [{ provide: SELECTION_MODEL_FACTORY, useValue: CustomSelectionFactory }];
// selection-model.ts
export function CustomSelectionFactory() {
return new CustomSelectionModel();
}
export class CustomSelectionModel implements SelectionModel {
// ...
}