Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there anything wrong with "move(-1)" as an AngularJS expression?

I'm getting this error: [$parse:ueoe] Unexpected end of expression: move(

From this code: <button type="button" ng-click="move(-1)" tabindex="-1">

Is there something syntactically wrong with move(-1) in AngularJS?

Side note: I seem to have errors cropping up anywhere I have a minus sign in an Angular expression. For example: <span data-ng-click=" order('-name') " data-ng-class="{active: column == '-name'}"> is throwing a different error: Lexer Error: Unterminated quote at columns 6-7 ['] in expression [order('].

From everything I've read, these don't seem like syntax errors to me. Is there something else going on here?

like image 632
Ben Harold Avatar asked Dec 20 '22 02:12

Ben Harold


2 Answers

I had the same thing. Check to make sure that it isn't one of your Chrome extensions that is causing the problem. I disabled Batarang specifically and the error went away.

like image 191
dsundy Avatar answered Dec 24 '22 01:12

dsundy


I'm facing the same problem and spent a few hours in it, but no luck. But hopefully my findings would be helpful.

The "bug" only happens on my main chrome windows, doesn't happen on incognito window, FF and IE.

In my case I tried to use: ng-click="changeScore(data.game.home, -1)", it reports ueoe. Tried to change to other arguments, but it doesn't work as long as it contains a dash:

changeScore(-1)
changeScore('-1')
changeScore('abc-efg')

When I step through angular.js, it seems like it has successfully parsed changeScore(data.game.home, -1) and then try to parse changeScore(data again, which is an incomplete statement, resulting error. But unfortunately I can't tell what has triggered the re-parse and can't reproduce it in jsfiddle.

like image 37
Icycool Avatar answered Dec 24 '22 01:12

Icycool