原 controller :angularjs
$scope.myURL = URL;url
页面:.net
<iframe ng-src='{{myURL}}' class="width-100 height-100"></iframe>get
发现页面不能打开 <iframe> 中的内容。iframe
如今将 controller 中改写以下 便可:class
$scope.myURL = $sce.trustAsResourceUrl(URL); //URL 为全连接($sce.trustAsResourceUrl("http://" + url))angular
trustAsResourceUrl 是 AngularJS 中防止用户注入 URL 的方法。rust