Jyi*_*ina 0 asp.net-mvc-4 angularjs
我在View中有一个iframe控件。
<iframe width="100%" height="800" ng-src="{{IframeSrcUrl}}"></iframe>
Run Code Online (Sandbox Code Playgroud)
在控制器中,我有一个范围变量,如下所示。但是iframe无法从作用域变量获取网址。另外,我们如何在控制器中附加其他查询字符串参数?
$scope.IframeSrcUrl = 'https://mmr.com';
Run Code Online (Sandbox Code Playgroud)
谢谢!
例如,使用$ sce服务:
<iframe width="100%" height="800" ng-src="{{IframeSrcUrl | trustAsResourceUrl}}"></iframe>
app.filter('trustAsResourceUrl', ['$sce', function($sce) {
return function(val) {
return $sce.trustAsResourceUrl(val);
};
}])
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
2956 次 |
最近记录: |