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

Model bindings #29

Merged
merged 7 commits into from Sep 19, 2017
Merged

Model bindings #29

merged 7 commits into from Sep 19, 2017

Conversation

varnastadeus
Copy link
Member

No description provided.

@varnastadeus
Copy link
Member Author

varnastadeus commented Sep 17, 2017

fixes #28

@ng-select ng-select deleted a comment from coveralls Sep 17, 2017
@ng-select ng-select deleted a comment from coveralls Sep 17, 2017
@coveralls
Copy link

Coverage Status

Coverage decreased (-0.1%) to 76.415% when pulling 1423378 on model-bindings into 06b79a6 on master.

Copy link
Member

@anjmao anjmao left a 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(() => {
Copy link
Member

@anjmao anjmao Sep 18, 2017

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')

index = index > -1 ? index :
this.itemsList.items.findIndex(x => x[this.labelKey] === value[this.labelKey])
}
this.itemsList.select(this.itemsList.items[index]);
Copy link
Member

@anjmao anjmao Sep 18, 2017

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

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.2%) to 76.376% when pulling b2eb1c7 on model-bindings into 06b79a6 on master.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.2%) to 76.779% when pulling cd24364 on model-bindings into 06b79a6 on master.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.2%) to 76.779% when pulling 35381bd on model-bindings into 06b79a6 on master.

@varnastadeus varnastadeus merged commit d976c37 into master Sep 19, 2017
@varnastadeus varnastadeus deleted the model-bindings branch September 19, 2017 10:35
jakemdunn pushed a commit to jakemdunn/ng-select that referenced this pull request Oct 16, 2018
* 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
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

3 participants