app.js 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. var yltApp = angular.module('YellowLabTools', [
  2. 'ngRoute',
  3. 'indexCtrl',
  4. 'aboutCtrl',
  5. 'dashboardCtrl',
  6. 'queueCtrl',
  7. 'ruleCtrl',
  8. 'timelineCtrl',
  9. 'runsFactory',
  10. 'resultsFactory',
  11. 'menuService',
  12. 'gradeDirective',
  13. ]);
  14. yltApp.run(['$rootScope', '$location', function($rootScope, $location) {
  15. $rootScope.loadedRunId = null;
  16. // Google Analytics
  17. $rootScope.$on('$routeChangeSuccess', function(){
  18. ga('send', 'pageview', {'page': $location.path()});
  19. });
  20. }]);
  21. yltApp.config(['$routeProvider', '$locationProvider',
  22. function($routeProvider, $locationProvider) {
  23. $routeProvider.
  24. when('/', {
  25. templateUrl: 'front/views/index.html',
  26. controller: 'IndexCtrl'
  27. }).
  28. when('/queue/:runId', {
  29. templateUrl: 'front/views/queue.html',
  30. controller: 'QueueCtrl'
  31. }).
  32. when('/about', {
  33. templateUrl: 'front/views/about.html',
  34. controller: 'AboutCtrl'
  35. }).
  36. when('/result/:runId', {
  37. templateUrl: 'front/views/dashboard.html',
  38. controller: 'DashboardCtrl'
  39. }).
  40. when('/result/:runId/timeline', {
  41. templateUrl: 'front/views/timeline.html',
  42. controller: 'TimelineCtrl'
  43. }).
  44. when('/result/:runId/rule/:policy', {
  45. templateUrl: 'front/views/rule.html',
  46. controller: 'RuleCtrl'
  47. }).
  48. otherwise({
  49. redirectTo: '/'
  50. });
  51. $locationProvider.html5Mode(true);
  52. }
  53. ]);