简体   繁体   中英

ui-sref pass params from controller

I need to pass a value from a view to another using ui-sref and the url params in AngularJS like this example:

<a ui-sref="new-qs({ portfolioId: {{id}} })">New (query string)</a>

where {{id}} is a variable from my controller. But I've got an Error: [$parse:syntax] error. Is it possible to do this operation, or I just can't?

请尝试以下操作:

<a ui-sref="new-qs({ 'portfolioId': id })">New (query string)</a>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM