-
Notifications
You must be signed in to change notification settings - Fork 70
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
1,650 additions
and
485 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,3 @@ | ||
/** | ||
* The solution to tracking page views and events in a SPA with AngularJS | ||
* @version v0.2.4 - 2014-04-21 | ||
* @link https://github.com/mgonto/angularytics | ||
* @author Martin Gontovnikas <[email protected]> | ||
* @license MIT License, http://www.opensource.org/licenses/MIT | ||
*/ | ||
(function () { | ||
angular.module('angularytics', []).provider('Angularytics', function () { | ||
var eventHandlersNames = ['Google']; | ||
|
@@ -29,7 +22,6 @@ | |
'$rootScope', | ||
'$location', | ||
function ($injector, $rootScope, $location) { | ||
// Helper methods | ||
var eventHandlers = []; | ||
angular.forEach(eventHandlersNames, function (handler) { | ||
eventHandlers.push($injector.get('Angularytics' + handler + 'Handler')); | ||
|
@@ -40,7 +32,6 @@ | |
}); | ||
}; | ||
var service = {}; | ||
// Just dummy function so that it's instantiated on app creation | ||
service.init = function () { | ||
}; | ||
service.trackEvent = function (category, action, opt_label, opt_value, opt_noninteraction) { | ||
|
@@ -57,7 +48,6 @@ | |
} | ||
}); | ||
}; | ||
// Event listening | ||
$rootScope.$on(pageChangeEvent, function () { | ||
service.trackPageView($location.url()); | ||
}); | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Binary file not shown.
Oops, something went wrong.