This is my HTML Cod
<ion-view view-title="Home" ng-controller="makeOrderController">
<input type="search" placeholder="Tìm kiếm" ng-model="searchKeyword" ng-change="searchMenu()" >
</ion-view>
This is my JS code
....
.controller('makeOrderController', ['$scope', function ($scope) {
$scope.searchMenu = function ($scope) {
console.log($scope.searchKeyword);
}
}]);
Yeah. When i type on the search textbox, the searchMenu() method is executed, but it raised an error
Cannot read property 'searchKeyword' of undefined
I have searched on SO, I tried :
To add
$parent.to ng-modelOr use js statement is $
scope.model.searchKeyword. But these code are not work :(
Please help me to help the console.log write updated keyword on user type.
yeoman ionic-generatormodule, it's built in. This would catch those sort of errors.