forked from johnhidey/angular-appinsights
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.js
32 lines (24 loc) · 981 Bytes
/
main.js
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
// fe43bead-b7b1-4e6c-b273-5a101ba16b9c
/*global angular: true */
(function () {
"use strict";
angular.module('insightsApp', ['ngRoute', 'angular-appinsights'])
.config(['$routeProvider', 'insightsProvider', function ($routeProvider, insightsProvider) {
$routeProvider
.when('/', {
templateUrl: "page1.html",
controller: 'page1Controller'
})
.when('/page2', {
templateUrl: "page2.html"
});
// Add application insights id here
insightsProvider.start('Application Insights App Id Goes Here');
}])
.controller('page1Controller', ['$scope', 'insights', function($scope, insights) {
insights.logEvent('Page 1 Controller Activated');
$scope.exit = function () {
insights.logEvent('User clicked the exit button');
};
}]);
}());