ionic getting textbox value

前端 未结 3 1321
春和景丽
春和景丽 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

    I am not sure about ionic2 but in ionic 1 we can do like below:

    Here is an example to store the value of use input text into and object

    
    
    
    

    in your js file

    $scope.login= function(username,password){
       console.log(username);
       console.log(password);
    var loginUser = {
         "username":username,
         "password":password
    };
    console.log(loginUser);
    

    check this answer it always work for me.

提交回复
热议问题