I’m trying to use dynamically generated content ($sce.trustAsHtml
) and insert it into my ionic app. This works fine in the browser (tested on Chrome on Windows and Safari on mac) but when I try to do the same thing in the iOS simulator or on the device no content is loaded.
My controller is something like this:
vm.content = $sce.trustAsHtml('<iframe src="http://google.com"></iframe>');
And my markup looks like:
<ion-view>
<ion-content data-ng-bind-html="vm.content">
</ion-content>
</ion-view>
I’ve also tried adding this config section to the angular app:
angular
.module('app', [])
.config(function($sceDelegateProvider) {
$sceDelegateProvider.resourceUrlWhitelist([
'self',
'**' // I've also tried being very specific with this -- same result
]);
});
And in the cordova config:
<access origin="*"/>