How to use ng-if to test if a variable is defined

后端 未结 3 1261
隐瞒了意图╮
隐瞒了意图╮ 2021-02-04 23:24

Is there a way to use ng-if to test if a variable is defined, not just if it\'s truthy?

In the example below (live demo), the HTML displays a shipping cost

3条回答
  •  说谎
    说谎 (楼主)
    2021-02-04 23:47

    I edited your plunker to include ABOS's solution.

    
        
    • The color is {{item.color}}
    • The shipping cost is {{item.shipping}}

    plunkerFork

提交回复
热议问题