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

php - How to add and update images or image url in Volusion using Volusion API -

Laravel mail error `Swift_TransportException in StreamBuffer.php line 269: Connection could not be established with host smtp.gmail.com [ #0]` -

c# SetCompatibleTextRenderingDefault must be called before the first -