Below is my code. In that when I click on fnAddCategory() , It does not give me any value.
> > > ><ion-content class="padding">
<form name="category" novalidate>
<div class="list">
<label class="item item-input item-floating-label">
<span class="input-label">Category Name</span>
<input type="text" placeholder="category Name" name="name" ng-model="categoryName" required>
</label>
<label class="item item-input item-stacked-label">
<span class="input-label">Category Image</span>
<br>
<input type="file" name="categoryImg" ng-model="categoryImg">
</label>
<span style="color:red" ng-show="category.name.$dirty && category.name.$invalid">
<span ng-show="category.name.$error.required">Category name is required.</span>
</span>
</div>
</form>
</ion-content>
And below is my controller code:
.controller(‘addCategoryController’, function ($scope, $location, $http, $stateParams) {
$scope.fnAddCategory = function (categoryName) {
alert(categoryName);
};
});
Plese help me with this code.