angularjs - Can't get input value in Angular (Ionic) -


i'm new angular , ionic , have problem getting value of input. "undefined". here code:

.controller('myctrl', function($scope) {      $scope.submit = function () {      console.log($scope.name);    }      }
 <form ng-submit="submit()">     <input type="text" ng-model="name">         <button class="button">send</button>   </form>

try this

 <form>    <input type="text" ng-model="name">     <button ng-click="submit()" class="button">send</button>  </form> 

Comments

Popular posts from this blog

sql - can we replace full join with union of left and right join? why not? -

javascript - Parallax scrolling and fixed footer code causing width issues -

iOS: Performance of reloading UIImage(name:...) -