Matteo Scandolo | 686547a | 2017-08-08 13:05:25 -0700 | [diff] [blame] | 1 | |
| 2 | /* |
| 3 | * Copyright 2017-present Open Networking Foundation |
| 4 | |
| 5 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 6 | * you may not use this file except in compliance with the License. |
| 7 | * You may obtain a copy of the License at |
| 8 | |
| 9 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | |
| 11 | * Unless required by applicable law or agreed to in writing, software |
| 12 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 | * See the License for the specific language governing permissions and |
| 15 | * limitations under the License. |
| 16 | */ |
| 17 | |
| 18 | |
Matteo Scandolo | e57712f | 2016-09-21 15:27:36 -0700 | [diff] [blame] | 19 | (function () { |
| 20 | 'use strict'; |
| 21 | |
| 22 | const data = [ |
| 23 | { |
| 24 | 'humanReadableName': 'cordSubscriber-1', |
| 25 | 'id': 1, |
| 26 | 'features': { |
| 27 | 'cdn': false, |
| 28 | 'uplink_speed': 1000000000, |
| 29 | 'downlink_speed': 1000000000, |
| 30 | 'uverse': true, |
| 31 | 'status': 'enabled' |
| 32 | }, |
| 33 | 'identity': {'account_num': '123', |
| 34 | 'name': 'My House'}, |
| 35 | 'related': { |
| 36 | 'instance_name': 'mysite_vsg', |
| 37 | 'vsg_id': 7, |
| 38 | 'compute_node_name': 'nova-compute-1', |
| 39 | 'c_tag': 111, |
| 40 | 'instance_id': 1, |
| 41 | 'wan_container_ip': '10.168.0.3', |
| 42 | 'volt_id': 6, |
| 43 | 's_tag': 222 |
| 44 | } |
| 45 | } |
| 46 | ] |
| 47 | |
| 48 | angular.module('ngXosLib') |
| 49 | .service('Resource', function($q){ |
| 50 | this.query = () => { |
| 51 | const d = $q.defer(); |
| 52 | console.log(data); |
| 53 | d.resolve(data) |
| 54 | |
| 55 | return {$promise: d.promise} |
| 56 | } |
| 57 | }) |
| 58 | .component('smartTableTest', { |
| 59 | restrict: 'E', |
| 60 | bindings: {}, |
| 61 | bindToController: true, |
| 62 | controllerAs: 'vm', |
| 63 | templateUrl: 'templates/smart-table.dev.html', |
| 64 | controller: function () { |
| 65 | this.config = { |
| 66 | resource: 'Resource' |
| 67 | }; |
| 68 | } |
| 69 | }) |
| 70 | })(); |