ng-model is undefined in controller

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

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


  

        
5条回答
  •  攒了一身酷
    2020-12-10 04:17

    Hey Jean,Have a look of it your code is working here

            
    
    
    var app= angular.module("app",[]);
        app.controller('loginController', ['$scope', 
          function($scope, $localstorage) {
    
          $scope.membershipNo;
          $scope.password;
          $scope.login = function () {
            alert("User logged in with membership no: " + ($scope.membershipNo || '') +
            "\n and password: " + ($scope.password || ''));
          }
    
        }]);
    

提交回复
热议问题