javascript - Angular JS ng-src -


i want include image using angular js. set 2 variables json file:

if (typeof images !== 'undefined') {     $scope.imgfirst = images.first;     $scope.showimage = true; } else {     $scope.showimage = false; } 

but following doesn't work, see alt-text , no picture. link 100% right, print json console , there link should be. <p><img ng-show="showimage" ng-src="{{imgfirst}}" width=95% alt="no picture available">first image.</img></p>

what's wrong? help.

if (typeof images !== 'undefined') {     $scope.imgfirst = images.first;     $scope.showimage = true; } else {     $scope.showimage = false; } $scope.$apply(); 

Comments

Popular posts from this blog

How has firefox/gecko HTML+CSS rendering changed in version 38? -

javascript - Complex json ng-repeat -

jquery - Cloning of rows and columns from the old table into the new with colSpan and rowSpan -