blob: 4460f149c0bfda874b4d77c9533a8ec1f250796d [file] [log] [blame]
Bri Prebilic Colee0311892015-05-15 11:27:15 -07001/*
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 () {
18 'use strict';
19
Bri Prebilic Coled189e282015-06-05 10:00:22 -070020 var urlSuffix = '/rs/dashboard';
Bri Prebilic Cole3c3361c2015-05-19 12:07:29 -070021
Bri Prebilic Colee0311892015-05-15 11:27:15 -070022 angular.module('cordHome', [])
Bri Prebilic Cole3c3361c2015-05-19 12:07:29 -070023 .controller('CordHomeCtrl', ['$log', '$scope', '$resource',
24 function ($log, $scope, $resource) {
25 var DashboardData, resource;
Bri Prebilic Cole60553c82015-06-05 08:50:17 -070026 $scope.page.curr = 'dashboard';
Bri Prebilic Cole3c3361c2015-05-19 12:07:29 -070027
Bri Prebilic Coled189e282015-06-05 10:00:22 -070028 DashboardData = $resource($scope.shared.url + urlSuffix);
Bri Prebilic Cole3c3361c2015-05-19 12:07:29 -070029 resource = DashboardData.get({},
30 // success
31 function () {
32 $scope.bundle = resource.bundle;
33 $scope.users = resource.users;
34 },
35 // error
36 function () {
37 $log.error('Problem with resource', resource);
38 });
39 $log.debug('Resource received:', resource);
40
41 $log.debug('Cord Home Ctrl has been created.');
Bri Prebilic Colee0311892015-05-15 11:27:15 -070042 }]);
43}());