angular.module('myApp') .filter('trustUrl', function ($sce) { return function(url) { return $sce.trustAsResourceUrl(url); }; });