Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Customizable SelectionModel #784

Closed
wants to merge 1 commit into from
Closed

Conversation

pranasb
Copy link

@pranasb pranasb commented Sep 3, 2018

No description provided.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.004%) to 94.055% when pulling 55283c1 on pranasb:master into 5f63d13 on ng-select:master.

@@ -99,6 +100,7 @@ export class NgSelectComponent implements OnDestroy, OnChanges, AfterViewInit, C
@Input() searchFn = null;
@Input() clearSearchOnAdd = true;
@Input() labelForId = null;
@Input() selectionModel: SelectionModel = new DefaultSelectionModel();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add this input to readme

@@ -99,6 +100,7 @@ export class NgSelectComponent implements OnDestroy, OnChanges, AfterViewInit, C
@Input() searchFn = null;
@Input() clearSearchOnAdd = true;
@Input() labelForId = null;
@Input() selectionModel: SelectionModel = new DefaultSelectionModel();
Copy link
Member

@varnastadeus varnastadeus Sep 4, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should be done differently and you shouldn't pass implementation through input.
You can create abstract class which will serve as your DI token with default implementation. This way you could inject your custom implementation.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But this has to be done carefully to avoid the bug introduced in release 2.7.0 which binds all ng-select together (cf #787)

@varnastadeus
Copy link
Member

closing in favor of #785

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants