A simple angularjs directive to set focus on an element through the use of events.
You can choose one of:
- via Bower: by running
$ bower install angular-focus-on
from your console - download the minified file.
Below is a quick example showing the usage, you can also see an examples in the demo directory.
<div ng-controller="focusCtrl">
<input focus-on event="itemSelected">
<button ng-click="selectItem()">You should select this item</button>
</div>
angular.module('yourApp', ['kf.focusOn'])
.controller('focusCtrl', ['$scope', function($scope) {
$scope.selectItem() = function() {
$scope.$broadcast('itemSelected');
};
}]);
- Write tests.
- More documentation!
- Finish the tags-like-stackoverflow example.
License === MIT