“If you use ng-model, you have to have a dot in there.”  Make your model point to an object.property and you’ll be good to go.

 

$scope.formData = {};  // Make sure you assign this object before you accessing its child object 
$scope.login = function () {
  console.log("User logged in with membership no: " + $scope.formData.membershipNo +
  "\n and password: " + $scope.formData.password);
 }

<input type="text" placeholder="Membership No" ng-model="formData.membershipNo">
<input type="password" placeholder="Password" ng-model="formData.password">

ng-model dont create scope variable in ionic
Tagged on:         

Leave a Reply

Your email address will not be published. Required fields are marked *