Tuesday, 15 January 2013

angularjs - ui-sref error when use special character in params -



angularjs - ui-sref error when use special character in params -

here code

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

there '@' in paramater ,so error tips this

'error: [$parse:lexerr] lexer error: unexpected next character @ columns 7-7 [@] in look [{pname:@event}].'

i'm confused how pass @event .

the @ not valid sign javascript variables naming: valid javascript variable names

so expect, @event string value..., should work:

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

angularjs angular-ui-router

No comments:

Post a Comment