angular-focus-on

A directive to easily apply focus on an element through the use of events


Keywords
angularjs, focus
License
MIT-feh
Install
bower install angular-focus-on

Documentation

angular-focus-on

A simple angularjs directive to set focus on an element through the use of events.

Getting Started

You can choose one of:

  • via Bower: by running $ bower install angular-focus-on from your console
  • download the minified file.

Simple Example

Below is a quick example showing the usage, you can also see an examples in the demo directory.

simple demo

<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');
        };
    }]);

TODO's

License === MIT