https://github.com/maxisam/ngx-bowser
an angular2 wrap service for bowser, AOT ready
https://github.com/maxisam/ngx-bowser
angular aot bower semantic-release
Last synced: 7 months ago
JSON representation
an angular2 wrap service for bowser, AOT ready
- Host: GitHub
- URL: https://github.com/maxisam/ngx-bowser
- Owner: maxisam
- License: mit
- Created: 2017-04-14T18:58:50.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2017-04-16T06:12:21.000Z (about 9 years ago)
- Last Synced: 2025-01-12T05:52:44.242Z (over 1 year ago)
- Topics: angular, aot, bower, semantic-release
- Language: JavaScript
- Homepage:
- Size: 86.9 KB
- Stars: 2
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](http://commitizen.github.io/cz-cli/)
[](https://github.com/semantic-release/semantic-release)
[](https://travis-ci.org/maxisam/ngx-bowser)
[](https://www.npmjs.com/package/ngx-bowser)
[](https://github.com/maxisam/ngx-bowser/releases)
[]()
# ngx-bowser
A wrap service for [bowser](https://github.com/ded/bowser)
It works with angular version 2.0.0 and up
## Dependencies
+ Angular >=2.0.0
+ [bowser](https://github.com/ded/bowser)
## Install
You can get it on npm.
```
npm install ngx-bowser --save
```
## Build project
```
1. npm i
2. npm run build
```
### why ?
It is AoT compatible, so you don't need to worry about how to deal with 3rd party library with AoT.
It also comes with better type definition.
### How to use:
in ngModule:
```
imports: [BowserModule],
providers: [BowserService],
```
It provides all apis that bowser provides.
It also allows you to access bowser directly by `BowserService.bowser`
### Additional Features:
1. `BowserService.profile`: return a string of "[browser]-[version] ([user agent])"
2. `BowserService.userAgent`: return window.navigator.userAgent