jason zhong
jason zhong

Reputation: 101

ui-sref error when use special character in params

Here is my code

<a ui-sref="exeprofile({pname:@event})"></a>

there is a '@' in the paramater ,so I get error tips like this

'Error: [$parse:lexerr] Lexer Error: Unexpected next character at columns 7-7 [@] in expression [{pname:@event}].'

I'm confused about how to pass @event .

Upvotes: 2

Views: 590

Answers (1)

Radim K&#246;hler
Radim K&#246;hler

Reputation: 123861

The @ is not valid sign for JavaScript variables naming: Valid JavaScript variable names

So I expect, that @event is a string value..., then this should work:

<a ui-sref="exeprofile({pname:'@event'})"></a>

Upvotes: 1

Related Questions