'use strict';

/**
 * Main module of the application.
 */
angular
    .module('personalDataDashboardApp', [
        'ui.router',
        'ngAnimate',
        'ngResource',
        'ui.bootstrap'
    ])
    .run(['$rootScope', '$state', '$stateParams', function ($rootScope, $state, $stateParams) {
        $rootScope.$state = $state;
        $rootScope.$stateParams = $stateParams;
    }])
    .config(['$stateProvider', '$urlRouterProvider', function ($stateProvider,   $urlRouterProvider) {
        $urlRouterProvider.otherwise('/');

        $stateProvider
            .state('home', {
                url: '/',
                templateUrl: 'views/main.html',
                controller: 'MainCtrl'
            });
    }]);
'use strict';

/**
 * Main module of the application.
 */
angular
    .module('personalDataDashboardApp', [
        'ui.router',
        'ngAnimate',
        'ngResource',
        'ui.bootstrap'
    ])
    .run(['$rootScope', '$state', '$stateParams', '$location', function ($rootScope, $state, $stateParams, $location) {
        $rootScope.$state = $state;
        $rootScope.$stateParams = $stateParams;

        /*// Hookup Google Analytics for sub pages when viewed.
        $rootScope.$on('$viewContentLoaded', function(event) {
            $window.ga('send', 'pageview', { page: $location.url() });
        });*/
    }])
    .config(['$stateProvider', '$urlRouterProvider', function ($stateProvider,   $urlRouterProvider) {
        $urlRouterProvider.otherwise('/');

        $stateProvider
            .state('home', {
                url: '/',
                templateUrl: 'views/main.html',
                controller: 'MainCtrl'
            });
    }]);
Add Google Analytics to each angular page viewed
Add Google Analytics to each angular page viewed
