2014-05-12 20:08:19 +02:00
|
|
|
'use strict';
|
|
|
|
|
|
|
|
angular.module('ffffng', [
|
|
|
|
'ngSanitize',
|
|
|
|
'ngRoute',
|
|
|
|
'ng',
|
2014-06-06 13:06:31 +02:00
|
|
|
'leaflet-directive',
|
|
|
|
'templates-main'
|
2014-05-12 20:08:19 +02:00
|
|
|
])
|
|
|
|
.config(function ($routeProvider) {
|
|
|
|
$routeProvider
|
|
|
|
.when('/', {
|
|
|
|
templateUrl: 'views/main.html',
|
|
|
|
controller: 'MainCtrl',
|
|
|
|
title: 'Willkommen'
|
|
|
|
})
|
|
|
|
.when('/new', {
|
|
|
|
templateUrl: 'views/newNodeForm.html',
|
|
|
|
controller: 'NewNodeCtrl',
|
|
|
|
title: 'Neuen Knoten anmelden'
|
|
|
|
})
|
|
|
|
.when('/update', {
|
|
|
|
templateUrl: 'views/updateNodeForm.html',
|
|
|
|
controller: 'UpdateNodeCtrl',
|
|
|
|
title: 'Knotendaten ändern'
|
|
|
|
})
|
|
|
|
.otherwise({
|
|
|
|
redirectTo: '/'
|
|
|
|
});
|
|
|
|
})
|
|
|
|
.service('Navigator', function ($location) {
|
|
|
|
return {
|
|
|
|
home: function () {
|
|
|
|
$location.url('/');
|
|
|
|
},
|
|
|
|
newNode: function () {
|
|
|
|
$location.url('/new');
|
|
|
|
},
|
|
|
|
updateNode: function () {
|
|
|
|
$location.url('/update');
|
|
|
|
}
|
|
|
|
};
|
|
|
|
})
|
2014-05-31 19:19:36 +02:00
|
|
|
.run(function ($location, $rootScope, config) {
|
2014-05-12 20:08:19 +02:00
|
|
|
$rootScope.$on('$routeChangeSuccess', function (event, current) {
|
|
|
|
$rootScope.title = current.$$route.title;
|
2014-05-31 19:19:36 +02:00
|
|
|
$rootScope.config = config;
|
2014-05-12 20:08:19 +02:00
|
|
|
});
|
2014-05-31 19:19:36 +02:00
|
|
|
});
|