Are complex expressions possible in ng-hide / ng-show?

前端 未结 5 1055
难免孤独
难免孤独 2020-12-07 16:04

I want to do so:

ng-hide=\"!globals.isAdmin && mapping.is_default\"

but the expression evaluates always to false.

5条回答
  •  青春惊慌失措
    2020-12-07 16:47

    Use a controller method if you need to run arbitrary JavaScript code, or you could define a filter that returned true or false.

    I just tested (should have done that first), and something like ng-show="!a && b" worked as expected.

提交回复
热议问题