inline conditionals in angular.js

后端 未结 11 1096
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 01:52

    So with Angular 1.5.1 ( had existing app dependency on some other MEAN stack dependencies is why I'm not currently using 1.6.4 )

    This works for me like the OP saying {{myVar === "two" ? "it's true" : "it's false"}}

    {{vm.StateName === "AA" ? "ALL" : vm.StateName}}
    

提交回复
热议问题