angularJs 变量会有类型之分

<select  ng-model="inventory.vegetableId+''" ng-options="vegetable.id as vegetable.name for vegetable in vegetables">
<option value="">--- 蔬菜 ---</option>
</select>

当inventory.vegetableId 产生变化时, select却没有跳到对应的默认值,用法全部正确,但就是显示不去,随即用input text 绑定ng-model="inventory.vegetableId", 数值变化是正确的,之后猜测是不是类型关系,直接 +'' 数值显示正常, 略坑。
原文地址:https://www.cnblogs.com/yuanshixingdan/p/8126518.html