<iframe id="myframe" ng-src="{{url}}" width="100%" height="100%" seamless frameborder="0" ></iframe>
打开不同域的内容时报下面的错误:
blocked loading resource from url not allowed by $scedelegate policy
解决方案:
app.config(function($scedelegateprovider) {
$scedelegateprovider.resourceurlwhitelist([
// allow same origin resource loads.
'self',
// allow loading from our assets domain. notice the difference between * and **.
'http://media.w3.org/**']);
});
很简单的方法就解决了angularjs跨域使用iframe的问题,希望大家能够喜欢