angular.module('cnodejs.directives').directive( // Collection-repeat image recycling while loading // https://github.com/driftyco/ionic/issues/1742 'resetImg', function ($document) { return { restrict: 'A', link: function($scope, $element, $attributes) { var applyNewSrc = function (src) { var newImg = $element.clone(true); newImg.attr('src', src); $element.replaceWith(newImg); $element = newImg; }; $attributes.$observe('src', applyNewSrc); $attributes.$observe('ngSrc', applyNewSrc); } }; });
添加回答
举报
0/150
提交
取消