Simple angular version of JQuery Typing allows to bind callbacks for started and stopped typing events. No dependency for JQuery 😉
Include module angular-typing to your app
angular.module(..., ['angular-typing'])
Add the directive to your textbox
<div ng-controller="typeController as ctrl">
<input type="text" typing type-delay="400" type-start="ctrl.typeStart(value)" type-end="ctrl.typeEnd(value)" />
</div>
-
typing
- directive, can be used as an attribute or as a class -
type-delay
- the amount of time taken to triggertype-end
after the user stops typing. Default value is 400ms. -
type-start
- callback function triggered when the user starts typing. -
type-end
- callback function triggered after the user stops typing which inlcudes thetype-delay
.
Initialize type start and end functions in your controller
angular.module(...).controller("typeController",[..., function() {
this.typeStart = function(value) {
...
}
this.typeEnd = function(value) {
// update model, send server request etc..
...
}
}]);
Download Link. Live demo coming soon. 😁
This plugin is available under the MIT license.