Matteo Scandolo | 4eb4ccb | 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 | 61bea66 | 2016-01-26 17:21:39 -0800 | [diff] [blame] | 18 | 'use strict'; |
Matteo Scandolo | 4eb4ccb | 2016-01-26 11:02:16 -0800 | [diff] [blame] | 19 | |
Matteo Scandolo | 61bea66 | 2016-01-26 17:21:39 -0800 | [diff] [blame] | 20 | angular.module('cordHome', []) |
Matteo Scandolo | 3eaeb3e | 2016-01-28 13:26:50 -0800 | [diff] [blame] | 21 | .controller('CordHomeCtrl', function ($log, $scope, $cookies, cordConfig, SubscriberUsers) { |
Matteo Scandolo | 4eb4ccb | 2016-01-26 11:02:16 -0800 | [diff] [blame] | 22 | |
Matteo Scandolo | e062850 | 2016-01-27 14:42:42 -0800 | [diff] [blame] | 23 | $scope.page.curr = 'dashboard'; |
Matteo Scandolo | 61bea66 | 2016-01-26 17:21:39 -0800 | [diff] [blame] | 24 | |
Matteo Scandolo | 3eaeb3e | 2016-01-28 13:26:50 -0800 | [diff] [blame] | 25 | SubscriberUsers.query({subscriberId: $cookies.get('subscriberId')}).$promise |
Matteo Scandolo | e062850 | 2016-01-27 14:42:42 -0800 | [diff] [blame] | 26 | .then(function(res){ |
| 27 | $scope.bundle_name = cordConfig.bundles[cordConfig.activeBundle].name; |
| 28 | $scope.bundle_desc = cordConfig.bundles[cordConfig.activeBundle].desc; |
Matteo Scandolo | 61f05f5 | 2016-01-28 09:41:01 -0800 | [diff] [blame] | 29 | $scope.users = res; |
Matteo Scandolo | e062850 | 2016-01-27 14:42:42 -0800 | [diff] [blame] | 30 | }) |
| 31 | .catch(function(){ |
| 32 | $log.error('Problem with resource', SubscriberUsers); |
| 33 | }); |
| 34 | |
| 35 | $log.debug('Cord Home Ctrl has been created.'); |
| 36 | }); |
Matteo Scandolo | 4eb4ccb | 2016-01-26 11:02:16 -0800 | [diff] [blame] | 37 | }()); |