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
Post a Comment