I have defined a custom directive like this:
.directive('row', [function() {
return {
restrict: 'E',
templateUrl: 'chrome://mailtowebmails/content/resources/directives/row.htm'
};
}])
But when I try using it I get this error:
"Error: [$sce:insecurl] Blocked loading resource from url not allowed by $sceDelegate policy. URL: chrome://mailtowebmails/content/resources/directives/row.htm
TRY 0
I tried santizing like this:
.config( [
'$compileProvider',
function( $compileProvider )
{
$compileProvider.aHrefSanitizationWhitelist(/^\s*(filesystem:chrome):/);
}
])
But its not fixing it.
This is for an addon so the path to my file is on the filesystem.
TRY 1
I also tried:
var ANG_APP = angular.module('mailtowebmails', [])
.config(['$sceDelegateProvider', function ($sceDelegateProvider) {
$sceDelegateProvider.resourceUrlWhitelist(['self', new RegExp('chrome')]);
}])
I get this error then:
Error: [$injector:modulerr] Failed to instantiate module mailtowebmails due to: [$injector:modulerr] Failed to instantiate module $sceDelegateProvider due to: [$injector:nomod] Module '$sceDelegateProvider' is not available! You either misspelled the module name or forgot to load it. If
TRY 2
I also tried this as @Tribute recommended but it didnt work:
var ANG_APP = angular.module('mailtowebmails', [])
.directive('row', [function() {
return {
restrict: 'E',
templateUrl: 'chrome://mailtowebmails/content/resources/directives/row.htm'
};
}])
.controller('BodyController', ['$scope', '$sce', function($scope, $sce) {
$scope.trustSrc = function(src) {
return $sce.trustAsResourceUrl(src);
};