-
-
Notifications
You must be signed in to change notification settings - Fork 900
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
Model bindings #29
Model bindings #29
Conversation
fixes #28 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good job
@@ -145,6 +118,86 @@ describe('NgSelectComponent', function () { | |||
})); | |||
}); | |||
|
|||
describe('Pre-selected model', () => { | |||
it('should select by valueKey when primitive type', fakeAsync(() => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wrap these 3 tests in describe('single')
because there is block describe('multiple')
src/lib/src/ng-select.component.ts
Outdated
index = index > -1 ? index : | ||
this.itemsList.items.findIndex(x => x[this.labelKey] === value[this.labelKey]) | ||
} | ||
this.itemsList.select(this.itemsList.items[index]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is case when index will still be -1 (autocomplete) and calling this.itemsList.select
will cause error. Maybe call it only if index > -1
* bind value to object by default * write value tests and fixes * small fixes * add more tests * Check if index > -1 * add more tests * update readme and demo
No description provided.