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

Use multiple classes in ui-sref-active #2481

Closed
bampakoa opened this issue Jan 25, 2016 · 10 comments
Closed

Use multiple classes in ui-sref-active #2481

bampakoa opened this issue Jan 25, 2016 · 10 comments
Assignees

Comments

@bampakoa
Copy link

Hi,

When I use multiple classes in an ui-sref-active directive I get the following error in console:

[$parse:syntax] Syntax Error: Token 'class2' is an unexpected token at column 8 of the expression [class1 class2] starting at [class2].

AngularJS version: 1.3.20
UI-Router version: 0.2.16
Provided plunker: http://plnkr.co/edit/4y0KC38Vlnc57wy6owW9

@kmcarpenter
Copy link

+1 This bug is kicking my ass right now.

I checked the documentation and this still looks like it should work:

http://angular-ui.github.io/ui-router/site/#/api/ui.router.state.directive:ui-sref-active

[edit]
It seems to be the $scope.$eval added in the following commit.

@nateabele nateabele self-assigned this Jan 25, 2016
@nateabele
Copy link
Contributor

Wow, this looks like a legit regression. Sorry about that. Thanks for the report, I'll patch it up shortly.

@kmcarpenter
Copy link

I've been working on a simple fix. A try/catch around the $scope.$eval will work. Was just about to write a test and submit a PR.

working code

@nateabele
Copy link
Contributor

Hah, that's basically what I just did. If you beat me to it, great. 😄

@kmcarpenter
Copy link

PR Submitted. Feel free to do with it as you wish 😄

@nateabele
Copy link
Contributor

Merged. I'll push a release shortly.

@nateabele
Copy link
Contributor

@kmcarpenter
Copy link

Amazing. Thanks for the quick turnaround.

@nateabele
Copy link
Contributor

Happy to help. 😄

@fpipita
Copy link
Contributor

fpipita commented Feb 17, 2016

@kmcarpenter could you please submit a PR for this one for 1.0.0alpha0 as well? It has the same issue, if you can't I'll do it. Thanks!

ExpFront pushed a commit to ExpFront/ui-router that referenced this issue Jun 23, 2016
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 a pull request may close this issue.

4 participants