Matteo Scandolo | e57712f | 2016-09-21 15:27:36 -0700 | [diff] [blame] | 1 | (function () { |
| 2 | 'use strict'; |
| 3 | |
| 4 | const data = [ |
| 5 | { |
| 6 | 'humanReadableName': 'cordSubscriber-1', |
| 7 | 'id': 1, |
| 8 | 'features': { |
| 9 | 'cdn': false, |
| 10 | 'uplink_speed': 1000000000, |
| 11 | 'downlink_speed': 1000000000, |
| 12 | 'uverse': true, |
| 13 | 'status': 'enabled' |
| 14 | }, |
| 15 | 'identity': {'account_num': '123', |
| 16 | 'name': 'My House'}, |
| 17 | 'related': { |
| 18 | 'instance_name': 'mysite_vsg', |
| 19 | 'vsg_id': 7, |
| 20 | 'compute_node_name': 'nova-compute-1', |
| 21 | 'c_tag': 111, |
| 22 | 'instance_id': 1, |
| 23 | 'wan_container_ip': '10.168.0.3', |
| 24 | 'volt_id': 6, |
| 25 | 's_tag': 222 |
| 26 | } |
| 27 | } |
| 28 | ] |
| 29 | |
| 30 | angular.module('ngXosLib') |
| 31 | .service('Resource', function($q){ |
| 32 | this.query = () => { |
| 33 | const d = $q.defer(); |
| 34 | console.log(data); |
| 35 | d.resolve(data) |
| 36 | |
| 37 | return {$promise: d.promise} |
| 38 | } |
| 39 | }) |
| 40 | .component('smartTableTest', { |
| 41 | restrict: 'E', |
| 42 | bindings: {}, |
| 43 | bindToController: true, |
| 44 | controllerAs: 'vm', |
| 45 | templateUrl: 'templates/smart-table.dev.html', |
| 46 | controller: function () { |
| 47 | this.config = { |
| 48 | resource: 'Resource' |
| 49 | }; |
| 50 | } |
| 51 | }) |
| 52 | })(); |