forked from jacqueslareau/angular-bowser
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathindex.html
More file actions
40 lines (22 loc) · 730 Bytes
/
index.html
File metadata and controls
40 lines (22 loc) · 730 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<!DOCTYPE html>
<head>
<meta charset="utf-8">
<script src="node_modules/angular/angular.js"></script>
<script src="src/angular-bowser.js"></script>
</head>
<body ng-app="angular-bowser-demo">
<div ng-controller="MyCtrl">
<button ng-click="checkBrowser()">Check browser</button>
</div>
<script>
angular.module('angular-bowser-demo', ['jlareau.bowser'])
.controller('MyCtrl', ['$scope','bowser', function ($scope, bowser) {
$scope.checkBrowser = function() {
let browser = bowser.name;
let version = bowser.version;
alert(`Browser name: ${browser}, version: ${version}`);
};
}]);
</script>
</body>
</html>