inline conditionals in angular.js

后端 未结 11 1068
Happy的楠姐
Happy的楠姐 2020-11-28 01:37

I was wondering if there is a way in angular to conditionally display content other than using ng-show etc. For example in backbone.js I could do something with inline conte

11条回答
  •  醉梦人生
    2020-11-28 02:07

    if you want to display "None" when value is "0", you can use as:

     {{ $scope.amount === "0" ?  $scope.amount : "None" }} 
    

    or true false in angular js

     {{ $scope.amount === "0" ?  "False" : "True" }} 
    

提交回复
热议问题