Skip to content
This repository was archived by the owner on Oct 2, 2019. It is now read-only.

fix: Allow setting a ngClass on <ui-select> element #1447

Merged
merged 1 commit into from
Feb 18, 2016

Conversation

Magador
Copy link
Contributor

@Magador Magador commented Feb 17, 2016

Since a ngClass is already present in the uiSelect theme templates, we could not add any ngClass on without getting an JS error
Currently, adding a ngClass on result in:
ng-class="{class: expression} {open: $select.open}"
With this fix, doing the same thing result in:
ng-class="{class: expression, open: $select.open}"

Closes #277

Maybe I should write a test case ?

Since a ngClass is already present in the uiSelect theme templates, we could not add any ngClass on <ui-select> without getting an JS error
Currently, adding a ngClass on <ui-select> result in:
`ng-class="{class: expression} {open: $select.open}"`
With this fix, doing the same thing result in:
`ng-class="{class: expression, open: $select.open}"`

Closes angular-ui#277
aaronroberson added a commit that referenced this pull request Feb 18, 2016
fix(ui-select): allow setting a ngClass on <ui-select> element

Since a ngClass is already present in the uiSelect theme templates, we could not add any ngClass on without getting an JS error
Currently, adding a ngClass on result in:
ng-class="{class: expression} {open: $select.open}"
With this fix, doing the same thing result in:
ng-class="{class: expression, open: $select.open}"

Closes #277
@aaronroberson aaronroberson merged commit 2fb6452 into angular-ui:master Feb 18, 2016
@Narretz
Copy link
Contributor

Narretz commented Feb 18, 2016

Even such a small change should have a test, imo.

@aaronroberson
Copy link
Contributor

Agreed. @Magador can you add the test in another PR?

@Magador
Copy link
Contributor Author

Magador commented Feb 18, 2016

Sure ! You'll have it by 12PM UTC tomorrow :)

Magador pushed a commit to Magador/ui-select that referenced this pull request Feb 19, 2016
Magador pushed a commit to Magador/ui-select that referenced this pull request Feb 19, 2016
…uiSelect

References PR angular-ui#1447
- Add missing test on uiSelect when merging ngClass attributes between DOM declaration and template
- Add one property `attrs.ngClass` in `createUiSelect(attrs)` to append a `ng-class` attribute to the <ui-select> element
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ng-class on ui-select
3 participants