Angular $scope.form value undefined on submit in ionic framework.

Angular $scope.form value undefined on submit in ionic framework.

In this post we will give you information about Angular $scope.form value undefined on submit in ionic framework.. Hear we will give you detail about Angular $scope.form value undefined on submit in ionic framework.And how to use it also give you demo for it if it is necessary.

When i was working first time in ionic framework with search module. i fetch one issue i can’t get ng-model value in angular js controller on submit form. i was try like $scope.form because if you work on angular JS before then you can get all post data using $scope.form directly, But i try with bellow form and try to get that way but i always find undefined value on form, But at last i found how to solve this issue. you can see bellow example and find your solution.

Form

<form method="POST" name="searchForm" ng-submit="search()">

<div >

<label >

<input ng-model="form.keyword" type="text" required>

</label>

<button type="submit">

<i ></i>

</button>

</div>

</form>

Controller

.controller('SearchCtrl', function($scope,$http) {

$scope.posts = [];

$scope.search=function(){

var form = this.form;

console.log(form);

$http.post(url+'/api/get_search_post',form).success(function(items) {

$scope.posts = $scope.posts.concat(items.data);

});

};

});

Hope this code and post will helped you for implement Angular $scope.form value undefined on submit in ionic framework.. if you need any help or any feedback give it in comment section or you have good idea about this post you can give it comment section. Your comment will help us for help you more and improve us. we will give you this type of more interesting post in featured also so, For more interesting post and code Keep reading our blogs

For More Info See :: laravel And github

Leave a Comment

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

4  +  3  =  

We're accepting well-written guest posts and this is a great opportunity to collaborate : Contact US