4.0.3 • Published 2 years ago

ng-browser-detector v4.0.3

Weekly downloads
59
License
MIT
Repository
github
Last release
2 years ago

ng-browser-detector Tests

A simple angularJs service to detect platform, browser and version.

live demo here

Getting Started

Installation

You can directly clone/download here

git clone https://github.com/sibiraj-s/ng-browser-detector.git

or use cdn

Minified:

//cdn.jsdelivr.net/npm/ng-browser-detector@latest/ng-browser-detector.min.js

Pretty Printed:

//cdn.jsdelivr.net/npm/ng-browser-detector@latest/ng-browser-detector.js

or

Install via Package managers such as npm or yarn

npm install browser-dtector
npm install ng-browser-detector

# or

yarn add browser-dtector
yarn add ng-browser-detector

Usage

Import the modules required for ng-browser-detector.

<script src="angular.min.js"></script>
<script src="browser-dtector.umd.min.js"></script>
<script src="ng-browser-detector.min.js"></script>

add ngBrowser dependency to the module

const app = angular.module('myApp', ['ngBrowser']);

in routes config

function BrowserDetectController($scope, appBrowser) {
  $scope.appBrowser = appBrowser;
}

app.controller('BrowserDetectController', ['$scope', 'appBrowser', BrowserDetectController]);

to get platform

appBrowser.getPlatformName();

refer https://github.com/sibiraj-s/browser-dtector#api for more info

A simple directive is included (usage : optional)

<body browser-detector></body>

the directive appends the browser details to element's class, if provided browser-detector="attr" then the details are added as attributes

4.0.3

2 years ago

4.0.2

3 years ago

4.0.1

4 years ago

4.0.0

4 years ago

3.0.0

4 years ago

2.0.1

4 years ago

2.0.0

4 years ago

1.1.7

5 years ago

1.1.6

6 years ago

1.1.5

6 years ago

1.1.4

6 years ago

1.1.3

6 years ago

1.1.2

6 years ago

1.1.1

6 years ago

1.1.0

6 years ago

1.0.1

6 years ago

1.0.0

7 years ago