如何将静态字符串添加到受信任的ng-src?

时间:2016-04-26 11:34:31

标签: javascript angularjs

如何实现以下目标?

<iframe ng-src="{{url | trusted}} + '?staticparam=test'"...>

结果:

Error: $interpolate:noconcat
Multiple Expressions

2 个答案:

答案 0 :(得分:1)

试试这个

&#13;
&#13;
<iframe ng-src="{{url  + '?staticparam=test' | trusted}}"...>
&#13;
&#13;
&#13;

答案 1 :(得分:1)

ng-init可能有助于追加:

<iframe ng-src="{{url | trusted}}" ng-init = "url = url + '?staticparam=test'">