AngularJS null value for select

后端 未结 9 910
攒了一身酷
攒了一身酷 2021-02-01 14:32

I couldn\'t find an elegant way for setting null values with a

9条回答
  •  囚心锁ツ
    2021-02-01 14:59

    Can you try to use parseInt on the value? For example, both "1" and "0" will equal their respective integer values. If you run the empty string through parseInt you can easily get NaN.

    > parseInt("") = NaN
    
    > parseInt("0") === 0
    
    > parseInt("1") === 1
    

提交回复
热议问题