Skip to content

An AngularJS service to detect client browser and version

License

Notifications You must be signed in to change notification settings

andrew-moldovan/angular-bowser

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

angular-bowser

This is a simple AngularJS service to provide browser information. It's heavily based on bowser code.

Dependencies

None except for AngularJS.

Install

bower install angular-bowser

Usage

Include src/angular-bowser.js in your html.

<script src="bower_components/angular-bowser/src/angular-bowser.js"></script>

Add the angular-bowser module as a dependency to your application module:

angular.module('MyApp', ['jlareau.bowser']);

Inject the service where you need it. A good place is in the run section of your application.

angular.module('MyApp')
  .run(['bowser', function(bowser) {
    
    if ( bowser.msie && bowser.version <= 6 ) {
      alert('Seriously?!');
    }
    
  }]);

Properties

Example of properties are: firefox, chrome, msie, opera, android, ios, safari

The browser version is always in the version property.

For more information, please check bowser.

About

An AngularJS service to detect client browser and version

Resources

License

Stars

Watchers

Forks

Packages

No packages published