Gets the initial focusable DOM element.
(static) getInitial(depthopt, groupopt) → {DOMElement}
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
depth |
number |
<optional> |
The focusable depth to search for. Default value is FocusConstant.DEFAULT.DEPTH. |
group |
string |
<optional> |
The focusable group to search for. Default value is FocusConstant.DEFAULT.GROUP. |
Returns:
If there is no initial element, returns null.
- Type
- DOMElement
Example
angular.module('myApp', ['caph.focus']).controller('myController', ['$scope', 'focusController', 'nearestFocusableFinder', function($scope, focusController, nearestFocusableFinder) {
$scope.initializeFocus = function() {
focusController.focus(nearestFocusableFinder.getInitial());
}
}]);