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

How to add static string to trusted ng-src?

本文关键字:信任 ng-src 添加 静态 字符串      更新时间:2023-09-26

如何实现以下目标?

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

结果:

Error: $interpolate:noconcat
Multiple Expressions

试试这个

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

ng-init可能有助于附加:

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