Bri Prebilic Cole | 7c92a3d | 2015-01-09 16:50:03 -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 | /* |
| 18 | ONOS GUI -- Sample View Module |
| 19 | |
| 20 | @author Simon Hunt |
| 21 | @author Bri Prebilic Cole |
| 22 | */ |
| 23 | |
| 24 | (function () { |
| 25 | 'use strict'; |
| 26 | |
| 27 | var urlSuffix = '/onos/v1/devices'; |
| 28 | |
Bri Prebilic Cole | 7c92a3d | 2015-01-09 16:50:03 -0800 | [diff] [blame] | 29 | angular.module('ovDevice', []) |
Bri Prebilic Cole | eb28b0b | 2015-01-15 14:20:58 -0800 | [diff] [blame] | 30 | .controller('OvDeviceCtrl', ['$log', '$location', |
Bri Prebilic Cole | 7c92a3d | 2015-01-09 16:50:03 -0800 | [diff] [blame] | 31 | function ($log, $http, $loc) { |
| 32 | var self = this; |
| 33 | self.deviceData = []; |
Bri Prebilic Cole | eb28b0b | 2015-01-15 14:20:58 -0800 | [diff] [blame] | 34 | //var url = buildUrl($loc) + urlSuffix; |
| 35 | //$log.log(url); |
Bri Prebilic Cole | 7c92a3d | 2015-01-09 16:50:03 -0800 | [diff] [blame] | 36 | |
Bri Prebilic Cole | eb28b0b | 2015-01-15 14:20:58 -0800 | [diff] [blame] | 37 | //$http.get(url).then( |
| 38 | // //success |
| 39 | // function (response) { |
| 40 | // self.deviceData = response.data.devices; |
| 41 | // }, |
| 42 | // //failure |
| 43 | // function (response) { |
| 44 | // $log.warn('Failed to get device data ', response.status); |
| 45 | // } |
| 46 | //); |
Bri Prebilic Cole | 7c92a3d | 2015-01-09 16:50:03 -0800 | [diff] [blame] | 47 | |
| 48 | $log.log('OvDeviceCtrl has been created'); |
| 49 | }]); |
| 50 | }()); |