blob: ea35436d02e48bc3ba863e904077bb57b193916f [file] [log] [blame]
Matteo Scandolo5d568612016-01-26 11:02:16 -08001/*
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 Scandolo680cd922016-01-26 17:21:39 -080018 'use strict';
Matteo Scandolo5d568612016-01-26 11:02:16 -080019
Matteo Scandolo680cd922016-01-26 17:21:39 -080020 angular.module('cordHome', [])
Matteo Scandoloe3aa41b2016-01-27 14:42:42 -080021 .controller('CordHomeCtrl', function ($log, $scope, cordConfig, SubscriberUsers) {
Matteo Scandolo5d568612016-01-26 11:02:16 -080022
Matteo Scandoloe3aa41b2016-01-27 14:42:42 -080023 $scope.page.curr = 'dashboard';
Matteo Scandolo680cd922016-01-26 17:21:39 -080024
Matteo Scandoloe3aa41b2016-01-27 14:42:42 -080025 // NOTE subscriberId should be retrieved by login
26 SubscriberUsers.query({subscriberId: 1}).$promise
27 .then(function(res){
28 $scope.bundle_name = cordConfig.bundles[cordConfig.activeBundle].name;
29 $scope.bundle_desc = cordConfig.bundles[cordConfig.activeBundle].desc;
30 $scope.users = res.users;
31 })
32 .catch(function(){
33 $log.error('Problem with resource', SubscriberUsers);
34 });
35
36 $log.debug('Cord Home Ctrl has been created.');
37 });
Matteo Scandolo5d568612016-01-26 11:02:16 -080038}());