javascript - Angularjs directive not working with img tag -


i replace img tag independent of ng-src. if remove ng-src feature not working , if ng-src='/avatars/original/missing.png' feature not working. if ng-src="http://s3.amazonaws.com/avatars/xxxxxxxxxxxxx.xxx" works.

   <img error-img object="target" data-color="#f37a5e" data-width="65px" data-height="65px" data-font-size="24px" ng-src="{{target.avatar_url}}" > 

directive code

auditionuprofessor.directive 'errorimg', ->   restrict: 'a'   scope:     object: '='   link: (scope, element, attrs) ->      chars = "no-image"      element.bind('error', ->        element.replacewith($("<div class='missing-image' href='javascript:;'>#{chars}</div>")   )     ) 

can help.


Comments

Popular posts from this blog

python - TypeError: start must be a integer -

c# - DevExpress RepositoryItemComboBox BackColor property ignored -

django - Creating multiple model instances in DRF3 -