Files
stf-DeviceFarmer-1/res/app/components/stf/common-ui/fallback-image/fallback-image-directive.js
Gunther Brunner 71e139ddaf Added a modal lightbox-image directive.
Added a fallback-image directive.
Added the Device Photo on the Info tab.
2014-06-18 18:57:20 +09:00

11 lines
259 B
JavaScript

module.exports = function fallbackImageDirective() {
return {
restrict: 'A',
link: function postLink(scope, element, attrs) {
element.on('error', function() {
angular.element(this).attr('src', attrs.fallbackImage)
})
}
}
}