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
Post a Comment