Thomas Vachuska | ee79ad3 | 2019-03-05 17:26:55 -0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2015-present Open Networking Foundation |
| 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 | Module containing the "business logic" for the layout topology overlay. |
| 19 | */ |
| 20 | |
| 21 | (function () { |
| 22 | 'use strict'; |
| 23 | |
| 24 | // injected refs |
| 25 | var $log, flash, wss; |
| 26 | |
| 27 | function doFoo(type, description) { |
| 28 | flash.flash(description); |
| 29 | wss.sendEvent('doFoo', { |
| 30 | type: type |
| 31 | }); |
| 32 | } |
| 33 | |
| 34 | function clear() { |
| 35 | // Nothing to do? |
| 36 | } |
| 37 | |
| 38 | angular.module('ovOdTopov', []) |
| 39 | .factory('OnlpDemoTopovService', |
| 40 | ['$log', 'FlashService', 'WebSocketService', |
| 41 | |
| 42 | function (_$log_, _flash_, _wss_) { |
| 43 | $log = _$log_; |
| 44 | flash = _flash_; |
| 45 | wss = _wss_; |
| 46 | |
| 47 | return { |
| 48 | doFoo: doFoo, |
| 49 | clear: clear |
| 50 | }; |
| 51 | }]); |
| 52 | }()); |