Question

broken demo : http://plnkr.co/edit/EWOvKsTEutiveMEAGTKf?p=preview

<li ng-show="showList" ng-repeat="task in tasks" ng-hide="task.checked=1">
  {{task.name}}
</li>

can I place ng-show and ng-hide on the same tag? I want to hide checked task but when I click show all list, the result would be a list that excluded checked task.

Était-ce utile?

La solution

how about using and(&&) or or(||) on the same attribute either ngHide or ngShow to evaluate the expression (exp1) || (expr2)? Like

ng-hide="Expr1=='something' || Expr2=='else'"

You can refer to this other POST for more information:

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

Here is a plunker demo

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top