相关疑难解决方法(0)

无法通过AngularJS控制器将URL加载到iframe中

我正在尝试通过AngularJS动态地将URL加载到iframe中.出于某种原因,我不能在这个小提琴中表现出来.有人可以告诉我我做错了什么吗?为什么我无法绑定到控制器中设置的URL?代码非常小:

<div ng-app ng-controller="LoginController">
    <div>Trying to load {{ customUrl }}</div>
    <div><iframe ng-src="{{trustSrc(customUrl)}}" height="480" width="640"></iframe></div>
</div>

function LoginController($scope) {
    $scope.customUrl = 'http://www.google.com/custom';
}
Run Code Online (Sandbox Code Playgroud)

谢谢!

javascript angularjs

3
推荐指数
1
解决办法
3102
查看次数

标签 统计

angularjs ×1

javascript ×1