How to set default selected value of ion-option?

前端 未结 9 1114
悲&欢浪女
悲&欢浪女 2020-12-09 03:18

I\'m using Ionic v2 and I can not set the selected value when showing the page.


    

        
9条回答
  •  时光说笑
    2020-12-09 03:35

    // binding the value available from ts file
        {{form.name}}
    
    

    inside your ts file

    name = this.forms[0].name //assign the variable name to the first index of your array
    

提交回复
热议问题