Matteo Scandolo | 5d56861 | 2016-01-26 11:02:16 -0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2015 Open Networking Laboratory |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
| 17 | (function () { |
Matteo Scandolo | 0a17d5c | 2016-01-26 11:34:15 -0800 | [diff] [blame] | 18 | 'use strict'; |
Matteo Scandolo | 5d56861 | 2016-01-26 11:02:16 -0800 | [diff] [blame] | 19 | |
Matteo Scandolo | 0a17d5c | 2016-01-26 11:34:15 -0800 | [diff] [blame] | 20 | var modules = [ |
| 21 | 'ngRoute', |
| 22 | 'ngResource', |
| 23 | 'ngAnimate', |
| 24 | 'cordMast', |
| 25 | 'cordFoot', |
| 26 | 'cordNav', |
| 27 | 'cordLogin', |
| 28 | 'cordHome', |
| 29 | 'cordUser', |
| 30 | 'cordBundle' |
Matteo Scandolo | 2b54546 | 2016-01-26 15:17:10 -0800 | [diff] [blame^] | 31 | ]; |
Matteo Scandolo | 5d56861 | 2016-01-26 11:02:16 -0800 | [diff] [blame] | 32 | |
Matteo Scandolo | 2b54546 | 2016-01-26 15:17:10 -0800 | [diff] [blame^] | 33 | angular.module('cordGui', modules) |
Matteo Scandolo | 0a17d5c | 2016-01-26 11:34:15 -0800 | [diff] [blame] | 34 | .config(['$routeProvider', function ($routeProvider) { |
| 35 | $routeProvider |
| 36 | .when('/login', { |
| 37 | controller: 'CordLoginCtrl', |
| 38 | controllerAs: 'ctrl', |
| 39 | templateUrl: 'app/view/login/login.html' |
| 40 | }) |
| 41 | .when('/home', { |
| 42 | controller: 'CordHomeCtrl', |
| 43 | controllerAs: 'ctrl', |
| 44 | templateUrl: 'app/view/home/home.html' |
| 45 | }) |
| 46 | .when('/user', { |
| 47 | controller: 'CordUserCtrl', |
| 48 | controllerAs: 'ctrl', |
| 49 | templateUrl: 'app/view/user/user.html' |
| 50 | }) |
| 51 | .when('/bundle', { |
| 52 | controller: 'CordBundleCtrl', |
| 53 | controllerAs: 'ctrl', |
| 54 | templateUrl: 'app/view/bundle/bundle.html' |
| 55 | }) |
| 56 | .otherwise({ |
| 57 | redirectTo: '/login' |
| 58 | }); |
| 59 | }]) |
| 60 | .controller('CordCtrl', ['$scope', '$location', |
| 61 | function ($scope, $location) { |
| 62 | $scope.shared = { |
| 63 | url: 'http://' + $location.host() + ':' + $location.port(), |
| 64 | userActivity: {} |
| 65 | }; |
| 66 | $scope.page = {}; |
| 67 | }]); |
Matteo Scandolo | 5d56861 | 2016-01-26 11:02:16 -0800 | [diff] [blame] | 68 | }()); |