我使用ngInit将变量从PHP传递到我的Angular JS控制器。 在某些情况下,通过字符串可能包含编码'“(双引号"
)Angular JS编码的双引号不起作用
<div data-ng-controller="UserController" data-ng-init='init({"test":""My Test Input""})'>
</div>
但是,当发生这种情况我得到的角JS以下错误: http://errors.angularjs.org/1.3.13/$parse/syntax?p0=My&p1=is%20unexpected%2C%20expecting%20%5B%7D%5D&p2=16&p3=init(%7B%22test%22%3A%22%22My%20Test%20Input%22%22%7D)&p4=My%20Test%20Input%22%22%7D)
请帮
使用单引号: - init({“test”:'“My Test Input”'}) – squiroid 2015-03-03 11:40:49