ionic getting textbox value

前端 未结 3 1314
春和景丽
春和景丽 2021-01-15 14:06

Hi I\'m new to ionic and I have the following html and js code. I am trying to get the value of user input on textbox upon clicking on the button. (If possible, I would like

3条回答
  •  时光取名叫无心
    2021-01-15 14:40

    Ionic works with angular which has two way binding as its core principal. There are lots of way to accomplish this but one way is to set a model of an html item. So if you set your input to have an ng model

    
    

    and then in your controller(class) you'll have

    this.inputName;
    

    It will hold the value changes from html.

提交回复
热议问题