setting initial value using ngModel for select dropdown

前端 未结 3 1285
灰色年华
灰色年华 2020-12-12 03:53

I have an array of tranTypes (transaction types) that are loaded into a dropdown. After the user selects a value and navigates to another component upon return

3条回答
  •  天命终不由人
    2020-12-12 04:27

    You should have the value binded to the ngModel exactly same as that of your object inside array.

    
    

    Best advisable to use id property as ngValue.

    LIVE DEMO

提交回复
热议问题