Skip to content

Instantly share code, notes, and snippets.

View adrianoxavier's full-sized avatar

Adriano Xavier adrianoxavier

View GitHub Profile
angular.module('analytics', [])
.service('analytics', function($rootScope, $window, $location) {
var track = function() {
$window._gaq.push(['_trackPageview', $location.path()]);
};
$rootScope.$on('$viewContentLoaded', track);
}
);
@adrianoxavier
adrianoxavier / template.html
Last active December 18, 2015 19:49
Call AngularJS when input "file" changes
<input type='file' onchange="angular.element(this).scope().setImage(this)" />