<iframe id="myFrame" ng-src="{{url}}" seamless frameborder="0" ></iframe>
Open contents of different domains and report the following error:
Blocked loading resource from url not allowed by $sceDelegate policy
Solution:
The code copy is as follows:
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/**']);
});
A very simple method solves the problem of using iframes across domains in angularjs. I hope everyone likes it.