onerrorsrc.directive.js 333 B

12345678910111213
  1. angular.module('odoo')
  2. .directive('onErrorSrc', function() {
  3. return {
  4. link: function(scope, element, attrs) {
  5. element.bind('error', function() {
  6. if (attrs.src != attrs.onErrorSrc) {
  7. attrs.$set('src', attrs.onErrorSrc);
  8. }
  9. });
  10. }
  11. }
  12. })