简体   繁体   中英

Evaluated expression not being parsed after updating to angular 1.2.5

This is the syntax i had with 1.0.8

<div ng-click="go('/albumDetail/{{album.albumID}}')">

And it worked perfectly. However, after updating to 1.2.5 (which also involved using the newly seperated routing module, not sure if thats related or not), album.albumID is not being parsed and is being sent as is. What is hapenning here ?

1.2 versions of Angular disallow interpolations inside DOM event handlers.

(cf. docs.angularjs.org/guide/migration)

Instead of using interpolation, you could just use plain JavaScript for the event handler expression to form your parameter:

go('/albumDetail/' + album.albumID)

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