I have a very simple app:
app = angular.module("GetTravelTime", ["ngResource"])
app.config ($routeProvider) ->
$routeProvider.when("/",
{
templateUrl: "assets/pages/partials/home_controls.html"
controller: HomeCtrl
}
)
@HomeCtrl = ($scope) ->
$scope.data = {
address: ""
}
$scope.change = (event) ->
console.log $scope.data.address
home_controls.html
<section class="controls" ng-controller="HomeCtrl">
<input type="text" placeholder="Location name or Post Code" ng-model="data.address" ng-change="change()"/>
</section>
What I am trying to do is when the input field is changed I want to trigger an event but only when the user has finished typing. At the moment each keystroke triggers the change event. I would like it so when they have finished typing it then triggers the event.
In jquery I would do something like click out of the box. Is there a neat way to do this in angular?