Skip to content Skip to sidebar Skip to footer

Angular Display Images When Field Set To 1

I have an angular app in this plunker In the app.js I have a JavaScript array named $scope.degrees. This variable has fields like {DegreeID:'1',DegreeCategoryID:'1',Degree:'Account

Solution 1:

You can use ng-show to archive this:

<!-- when $scope.degrees.BHC is truthy (element is visible) -->
<div ng-show="degrees.BHC">
  <img src="your_image" />
</div>

Angular will treat "0" as false.


Post a Comment for "Angular Display Images When Field Set To 1"