Reputation: 11
when we type a text in the input box then the loader starts loading. but we want loader only to work when we press enter key
// Function is called when user enter input any text in filter box $scope.gridGuestsApi.core.on.filterChanged($scope, function () { $scope.direct = false; $scope.oppvmware_guestlist_loading = true; // To show the loader });
this is html code
Upvotes: 0
Views: 144
Reputation: 6235
Possible to achive with keyup.enter
to trigger function loader()
. Can also be used with keydown
event listener. By relying upon Angular’s keydown.enter pseudo-event, it is no longer necessary to manually check to see if the event.key value is Enter - though you could pass in the $event
and check if it is Enter
e.g loader($event)
.
<input type="text" (keyup.enter)="loader()" />
Upvotes: 1