Skip to content

Commit

Permalink
fix(chips): do not display broken image when no image is provided
Browse files Browse the repository at this point in the history
When no image property is defined on the user model, do not render an `img`-element.

References angular#4779.
  • Loading branch information
Frank3K committed Sep 26, 2015
1 parent eacca5e commit 96e10b6
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/components/chips/js/contactChipsDirective.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@ var MD_CONTACT_CHIPS_TEMPLATE = '\
<div class="md-contact-suggestion">\
<img \
ng-src="{{item[$mdContactChipsCtrl.contactImage]}}"\
alt="{{item[$mdContactChipsCtrl.contactName]}}" />\
alt="{{item[$mdContactChipsCtrl.contactName]}}"\
ng-if="item[$mdContactChipsCtrl.contactImage]" />\
<span class="md-contact-name" md-highlight-text="$mdContactChipsCtrl.searchText"\
md-highlight-flags="{{$mdContactChipsCtrl.highlightFlags}}">\
{{item[$mdContactChipsCtrl.contactName]}}\
Expand All @@ -81,7 +82,8 @@ var MD_CONTACT_CHIPS_TEMPLATE = '\
<div class="md-contact-avatar">\
<img \
ng-src="{{$chip[$mdContactChipsCtrl.contactImage]}}"\
alt="{{$chip[$mdContactChipsCtrl.contactName]}}" />\
alt="{{$chip[$mdContactChipsCtrl.contactName]}}"\
ng-if="$chip[$mdContactChipsCtrl.contactImage]" />\
</div>\
<div class="md-contact-name">\
{{$chip[$mdContactChipsCtrl.contactName]}}\
Expand Down

0 comments on commit 96e10b6

Please sign in to comment.