AngularJS - filter for undefined properties in ng-repeat?

前端 未结 4 984
天涯浪人
天涯浪人 2021-02-05 00:43

For my AngularJS project (v1.2.3), I have a list of routes and am trying to build a navigation bar from the object. What I want to do is display any object with an undefined

4条回答
  •  自闭症患者
    2021-02-05 00:54

    You can negate a filter expression. So instead of dealing with undefined you can just filter out anything where isRight is not (!) true. Like this:

  • And for the opposite you can, of course, do:

  • demo fiddle

提交回复
热议问题