github.com/matm/etcd@v0.3.1-0.20140328024009-5b4a473f1453/mod/dashboard/app/scripts/app.js (about)

     1  'use strict';
     2  
     3  var app = angular.module('etcdControlPanel', [
     4    'ngRoute',
     5    'ngResource',
     6    'etcd',
     7    'etcdDirectives',
     8    'timeRelative',
     9    'underscore',
    10    'jquery',
    11    'moment',
    12    'vg'
    13  ]);
    14  
    15  app.constant('urlPrefix', '/mod/dashboard');
    16  app.constant('keyPrefix', '/v2/keys/');
    17  
    18  app.config(function($routeProvider, $locationProvider, urlPrefix) {
    19  
    20    function prefixUrl(url) {
    21      return urlPrefix + url;
    22    }
    23  
    24    $locationProvider.html5Mode(true);
    25  
    26    $routeProvider
    27      .when(prefixUrl('/'), {
    28        controller: 'HomeCtrl',
    29        templateUrl: prefixUrl('/views/home.html')
    30      })
    31      .when(prefixUrl('/stats'), {
    32        controller: 'StatsCtrl',
    33        templateUrl: prefixUrl('/views/stats.html')
    34      })
    35      .when(prefixUrl('/browser'), {
    36        controller: 'BrowserCtrl',
    37        templateUrl: prefixUrl('/views/browser.html')
    38      })
    39      .otherwise({
    40        templateUrl: prefixUrl('/404.html')
    41      });
    42  
    43  });