Skip to content
This repository was archived by the owner on Aug 29, 2021. It is now read-only.

Commit b2f939b

Browse files
author
Nick Radford
committed
docs(Readme): Fix broken link in readme, add kbInvoke documentation.
1 parent be2a004 commit b2f939b

File tree

1 file changed

+23
-12
lines changed

1 file changed

+23
-12
lines changed

Readme.md

Lines changed: 23 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ Keyboard behavior for AngularJS Webapps.
1414

1515
* [kbList & kbSelect demo](http://angular-keyboard.herokuapp.com/example-modes.html)
1616
* [Scroll and orientation demo](http://angular-keyboard.herokuapp.com/example-orientation.html)
17-
* [kbFocus demo](angular-keyboard.herokuapp.com/example-focus.html)
18-
* [kbInvoke demo](angular-keyboard.herokuapp.com/example-menu.html)
17+
* [kbFocus demo](http://angular-keyboard.herokuapp.com/example-focus.html)
18+
* [kbInvoke demo](http://angular-keyboard.herokuapp.com/example-menu.html)
1919

2020
## Installation
2121

@@ -41,14 +41,14 @@ angular.module('myApp', ['keyboard']);
4141

4242
### kbList
4343

44-
A kb-item in a kb-list can selected using the arrow keys and by clicking on the kb-item.
44+
A `kb-item` in a `kb-list` can selected using the arrow keys and by clicking on the `kb-item`.
4545

4646
#### Example
4747

4848
```html
49-
<div kb-list ng-model="selectedItem" ng-repeat="item in items">
50-
<div kb-item="item">{{item.title}}</div>
51-
</div>
49+
<div kb-list ng-model="selectedItem" ng-repeat="item in items">
50+
<div kb-item="item">{{item.title}}</div>
51+
</div>
5252
```
5353

5454
Example styling
@@ -64,22 +64,22 @@ Example styling
6464

6565
### kbSelect
6666

67-
A kb-item in a kb-select can activated using the arrow keys but is selected (and deselected) by pressing 'space' or 'enter' keys or clicking an the kb-item.
67+
A `kb-item` in a `kb-select` can activated using the arrow keys but is selected (and deselected) by pressing 'space' or 'enter' keys or clicking an the `kb-item`.
6868

6969
#### Example
7070

7171
```html
72-
<div kb-select ng-model="selectedItem" ng-repeat="item in items">
73-
<div kb-item="item">{{item.title}}</div>
74-
</div>
72+
<div kb-select ng-model="selectedItem" ng-repeat="item in items">
73+
<div kb-item="item">{{item.title}}</div>
74+
</div>
7575
```
7676

7777
### kbFocus
7878

7979
Setting or reading the focus via a service.
8080

8181
```html
82-
<input type="email" kb-focus="label">
82+
<input type="email" kb-focus="label">
8383
```
8484

8585
```js
@@ -91,10 +91,21 @@ app.controller('MyCtrl', function($scope, $kbFocus) {
9191
```
9292

9393
### kbAutofocus
94+
9495
Set the autofocus attribute based on an expression.
9596

9697
```html
97-
<input type="password" kb-autofocus="email != ''">
98+
<input type="password" kb-autofocus="email != ''">
99+
```
100+
101+
### kbInvoke
102+
103+
Add event handler to `kb-item`. Handles space and enter keypresses, and mouse clicks.
104+
105+
```html
106+
<ul kb-list ng-model="selectedItem" ng-repeat="item in items">
107+
<li kb-item="item" kb-invoke="select(item)">{{item.title}}</li>
108+
</ul>
98109
```
99110

100111
## Development

0 commit comments

Comments
 (0)