javascript - angularjs - loading images issues -
i have small issue how handle loading images browser not try load images cant find because angularjs havent kicked in yet. how can that?, ng-if? or ng-hide/show?, still find images tag before angularjs kicked in.
if can me how handle issue too: need have standard image time, if there campaign on site, need "overwrite" image data got http call
standard image <img class="img-responsive hidden-sm hidden-xs" src="/images/header.jpg"> <img class="img-responsive hidden-lg hidden-md" src="/images/header-mobile.jpg"> campaign image <img class="img-responsive hidden-sm hidden-xs" src="/images/{{campaign}}.jpg"> <img class="img-responsive hidden-lg hidden-md" src="/images/{{campaign}}-mobile.jpg">
you can use ng-src
. within attribute, can use {{campaign}}
markup.
in case should work with:
<img class="img-responsive hidden-lg hidden-md" ng-src="/images/{{campaign}}-mobile.jpg">
Comments
Post a Comment