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

c# SetCompatibleTextRenderingDefault must be called before the first -

c++ - Fill runtime data at compile time with templates -

C#.NET Oracle.ManagedDataAccess ConfigSchema.xsd -