forked from eclipse/vorto
-
Notifications
You must be signed in to change notification settings - Fork 0
/
devtoolApp.js
40 lines (33 loc) · 1.36 KB
/
devtoolApp.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
define("devtoolApp", ["angular", "angular-route", "angular-animate", "angular-aria", "angular-bootstrap", "angular-bootstrap-templates", "smart-table", "controllers", "directives", "jquery"], function(angular) {
var app = angular.module('devtoolApp', ['ngRoute', 'apps.controller', 'apps.directive', 'ngAnimate', 'ui.bootstrap', 'ui.bootstrap.tpls']);
app.bootstrap = function() {
angular.bootstrap(document, ['devtoolApp']);
};
app.config(['$routeProvider', '$httpProvider',
function($routeProvider, $httpProvider) {
$routeProvider
.when('/editor/:projectName', {
templateUrl: "templates/editor-template.html",
controller: 'EditorController'
})
.when('/project', {
templateUrl: "templates/project-template.html",
controller: 'ProjectController'
})
.otherwise({
redirectTo: '/project'
});
}
]).run(function($location, $http, $rootScope) {
$rootScope.getRepositoryBasePath = function() {
$http.get('./repository/basepath').success(function(data, status, headers, config) {
$rootScope.repoBasePath = data['basepath'];
console.log($rootScope.repoBasePath);
}).error(function(data, status, headers, config) {
$rootScope.repoBasePath = "/";
});
}
$rootScope.getRepositoryBasePath();
});
return app;
});