blob: c7de98525c3fd1f0b9bbdb9a2720f5ffaf1888eb [file] [log] [blame]
Matteo Scandolo4eb4ccb2016-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 Scandolo61bea662016-01-26 17:21:39 -080018 'use strict';
Matteo Scandolo4eb4ccb2016-01-26 11:02:16 -080019
Matteo Scandolo61bea662016-01-26 17:21:39 -080020 angular.module('cordHome', [])
Matteo Scandolo3eaeb3e2016-01-28 13:26:50 -080021 .controller('CordHomeCtrl', function ($log, $scope, $cookies, cordConfig, SubscriberUsers) {
Matteo Scandolo4eb4ccb2016-01-26 11:02:16 -080022
Matteo Scandoloe0628502016-01-27 14:42:42 -080023 $scope.page.curr = 'dashboard';
Matteo Scandolo61bea662016-01-26 17:21:39 -080024
Matteo Scandolo3eaeb3e2016-01-28 13:26:50 -080025 SubscriberUsers.query({subscriberId: $cookies.get('subscriberId')}).$promise
Matteo Scandoloe0628502016-01-27 14:42:42 -080026 .then(function(res){
27 $scope.bundle_name = cordConfig.bundles[cordConfig.activeBundle].name;
28 $scope.bundle_desc = cordConfig.bundles[cordConfig.activeBundle].desc;
Matteo Scandolo61f05f52016-01-28 09:41:01 -080029 $scope.users = res;
Matteo Scandoloe0628502016-01-27 14:42:42 -080030 })
31 .catch(function(){
32 $log.error('Problem with resource', SubscriberUsers);
33 });
34
35 $log.debug('Cord Home Ctrl has been created.');
36 });
Matteo Scandolo4eb4ccb2016-01-26 11:02:16 -080037}());