You could use a filter. These are available globally.
angular.module('myApp')
.filter('trustUrl', function ($sce) {
return function(url) {
return $sce.trustAsResourceUrl(url);
};
});
<img ng-src={{ imageHref | trustUrl }}">
More Related Contents:
- AngularJS: Service vs provider vs factory
- File Upload using AngularJS
- Why does AngularJS include an empty option in select?
- AngularJS access parent scope from child controller
- AngularJS: ng-model not binding to ng-checked for checkboxes
- Filtering by Multiple Specific Model Properties in AngularJS (in OR relationship)
- AngularJS: How to make angular load script inside ng-include?
- Injecting $scope into an angular service function()
- AngularJS: ng-show / ng-hide not working with `{{ }}` interpolation
- Enforcing unique usernames with Firebase simplelogin
- Angular $scope.$apply vs $timeout as a safe $apply
- How do I fix the npm UNMET PEER DEPENDENCY warning?
- Preserve line breaks in angularjs
- Using angularjs filter in input element
- How to access global js variable in AngularJS directive
- Getting an error when using ng-controller in angularjs ver 1.3.0 [duplicate]
- Click() function isn’t working in protractor scripts
- Send FormData with other field in AngularJS
- AngularJs: Reload page
- disable nganimate for some elements
- AngularJS dependency injection of value inside of module.config
- How to access/update $rootScope from outside Angular
- How to specify headers parameter for custom Angular $resource action
- AngularJS Folder Structure [closed]
- How to check internet connection in AngularJs
- Filter results 6 through 10 of 100 with ng-repeat in AngularJS
- Angular clear subform data and reset validation
- How to obtain previous item in ng-repeat?
- Auto logout with Angularjs based on idle user
- Angularjs – Hide content until DOM loaded