Javascript $sceDelegateProvider资源url白名单无效
HTML: 在fiddle之外执行上述操作时,控制台中出现以下js错误:Javascript $sceDelegateProvider资源url白名单无效,javascript,angularjs,iframe,Javascript,Angularjs,Iframe,HTML: 在fiddle之外执行上述操作时,控制台中出现以下js错误: Error: [$interpolate:noconcat] http://errors.angularjs.org/1.5.6/$interpolate/noconcat?p0=https%3A%2F%2Fwww.google.be%2Fsearch%3Fq%3D%7B%7Bquery%7D%7D at angular.js:38 at Function.Ka.throwNoconcat (angular
Error: [$interpolate:noconcat] http://errors.angularjs.org/1.5.6/$interpolate/noconcat?p0=https%3A%2F%2Fwww.google.be%2Fsearch%3Fq%3D%7B%7Bquery%7D%7D
at angular.js:38
at Function.Ka.throwNoconcat (angular.js:11887)
at k (angular.js:12193)
at ha (angular.js:9606)
at $b (angular.js:8553)
at s (angular.js:8378)
at s (angular.js:8394)
at s (angular.js:8394)
at aa (angular.js:8281)
at angular.js:1782
其中链接导致以下解释:
Error while interpolating: https://www.google.be/search?q={{query}}
Strict Contextual Escaping disallows interpolations that concatenate multiple expressions when a trusted value is required. See http://docs.angularjs.org/api/ng.$sce
这很奇怪,因为我把“**”列为白名单,我的小提琴就证明了这一点
为什么白名单没有任何效果?我认为ng src与$sce不兼容。在fiddle works中将ng src更改为ng bind html
<iframe ng-bind-html="https://www.google.be/search?q={{query}}"></iframe>
这确实会显示正确的html,但iframe根本不会呈现。我尝试使用{{query}},这实际上是测试iframe的更好的页面。google one永远不会在iframe中渲染。
Error while interpolating: https://www.google.be/search?q={{query}}
Strict Contextual Escaping disallows interpolations that concatenate multiple expressions when a trusted value is required. See http://docs.angularjs.org/api/ng.$sce
<iframe ng-bind-html="https://www.google.be/search?q={{query}}"></iframe>