ng-model is undefined in controller

前端 未结 5 982
醉话见心
醉话见心 2020-12-10 03:56

I\'m using ionic and I have the following view:


  

        
5条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-10 04:03

    Please check this code This is worked for me:

    and in your-controller:

    app.controller('loginController', ['$scope',
      function($scope) {
        $scope.data={};
      $scope.login = function () {
        console.log("User logged in with membership no: " + $scope.data.membershipNo +
        "\n and password: " + $scope.data.password);
      }
    
    }]);
    

提交回复
热议问题