Skip to content

Commit 8615014

Browse files
committed
doc() add README
1 parent 8d716f3 commit 8615014

File tree

2 files changed

+49
-1
lines changed

2 files changed

+49
-1
lines changed

README.md

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
angular-bowser
2+
====================
3+
4+
This is a simple [AngularJS](http://angularjs.org/) service to provide browser and browser information.
5+
It's heavily based on [bowser](https://github.com/ded/bowser) code.
6+
7+
### Dependencies
8+
9+
None except for AngularJS.
10+
11+
### Install
12+
13+
`bower install angular-bowser`
14+
15+
### Usage
16+
17+
Include src/angular-bowser.js in your html.
18+
19+
```html
20+
<script src="bower_components/angular-pnotify/src/angular-pnotify.js"></script>
21+
```
22+
23+
Add the angular-bowser module as a dependency to your application module:
24+
25+
```javascript
26+
angular.module('MyApp', ['jlareau.bowser']);
27+
```
28+
29+
Inject the service where you need it. A good place is in the run section of your application.
30+
31+
```javascript
32+
angular.module('MyApp')
33+
.run(['bowser', function(bowser) {
34+
35+
if ( bowser.msie && bowser.version <= 6 ) {
36+
alert('Seriously?!');
37+
}
38+
39+
}]);
40+
```
41+
42+
### Properties
43+
44+
Example of properties are: firefox, chrome, msie, opera, android, ios, safari
45+
46+
The browser version is always in the version property.
47+
48+
For more information, please check [bowser](https://github.com/ded/bowser).

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"authors": [
66
"Jacques Lareau <[email protected]>"
77
],
8-
"description": "A service to detect client browser and version",
8+
"description": "An AngularJS service to detect client browser and version",
99
"main": "./src/angular-bowser.js",
1010
"keywords": [
1111
"angular",

0 commit comments

Comments
 (0)