angular.module('app').run(['$rootScope', '$state', '$stateParams',
    function($rootScope, $state, $stateParams) {
        $rootScope.$state = $state;
        $rootScope.$stateParams = $stateParams;
    }
]).config(['$stateProvider', '$urlRouterProvider',
    function($stateProvider, $urlRouterProvider) {
        $urlRouterProvider.otherwise('/chartview');
        $stateProvider
            .state('chartview', {
                controller: 'ChartController',
                url: '/chartview',
                templateUrl: 'templates/chartview.html'
            });
    }
])