This is my HTML code.
<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); } }]);
Yes. When I type a search text field, the searchMenu () method is executed, but it causes an error
Cannot read property 'searchKeyword' of undefined
I searched for SO, I tried:
Please help me help console.log write the updated keyword by user type.
source share