简体   繁体   English

更新为角度1.2.5后未解析评估表达式

[英]Evaluated expression not being parsed after updating to angular 1.2.5

This is the syntax i had with 1.0.8 这是我在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. 但是,在更新到1.2.5(还涉及使用新分离的路由模块,不确定是否相关)之后,就不会解析而是按原样发送album.albumID。 What is hapenning here ? 这里正在发生什么?

1.2 versions of Angular disallow interpolations inside DOM event handlers. Angular的1.2版本不允许在DOM事件处理程序中进行插值。

(cf. docs.angularjs.org/guide/migration) (请参阅docs.angularjs.org/guide/migration)

Instead of using interpolation, you could just use plain JavaScript for the event handler expression to form your parameter: 除了使用插值法,您还可以将简单的JavaScript用于事件处理程序表达式以形成参数:

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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