diff options
author | CNlucius <lukai1@huawei.com> | 2016-09-13 11:40:12 +0800 |
---|---|---|
committer | CNlucius <lukai1@huawei.com> | 2016-09-13 11:41:53 +0800 |
commit | b731e2f1dd0972409b136aebc7b463dd72c9cfad (patch) | |
tree | 5107d7d80c19ad8076c2c97c2b5ef8d1cf3ab903 /framework/src/onos/tools/package/archetypes/ui/src/main/resources/archetype-resources/src/main/resources/app/view/sampleCustom/sampleCustom.js | |
parent | ee93993458266114c29271a481ef9ce7ce621b2a (diff) |
ONOSFW-171
O/S-SFC-ONOS scenario documentation
Change-Id: I51ae1cf736ea24ab6680f8edca1b2bf5dd598365
Signed-off-by: CNlucius <lukai1@huawei.com>
Diffstat (limited to 'framework/src/onos/tools/package/archetypes/ui/src/main/resources/archetype-resources/src/main/resources/app/view/sampleCustom/sampleCustom.js')
-rw-r--r-- | framework/src/onos/tools/package/archetypes/ui/src/main/resources/archetype-resources/src/main/resources/app/view/sampleCustom/sampleCustom.js | 69 |
1 files changed, 0 insertions, 69 deletions
diff --git a/framework/src/onos/tools/package/archetypes/ui/src/main/resources/archetype-resources/src/main/resources/app/view/sampleCustom/sampleCustom.js b/framework/src/onos/tools/package/archetypes/ui/src/main/resources/archetype-resources/src/main/resources/app/view/sampleCustom/sampleCustom.js deleted file mode 100644 index 21058640..00000000 --- a/framework/src/onos/tools/package/archetypes/ui/src/main/resources/archetype-resources/src/main/resources/app/view/sampleCustom/sampleCustom.js +++ /dev/null @@ -1,69 +0,0 @@ -// js for sample app custom view -(function () { - 'use strict'; - - // injected refs - var $log, $scope, wss, ks; - - // constants - var dataReq = 'sampleCustomDataRequest', - dataResp = 'sampleCustomDataResponse'; - - function addKeyBindings() { - var map = { - space: [getData, 'Fetch data from server'], - - _helpFormat: [ - ['space'] - ] - }; - - ks.keyBindings(map); - } - - function getData() { - wss.sendEvent(dataReq); - } - - function respDataCb(data) { - $scope.data = data; - $scope.$apply(); - } - - - angular.module('ovSampleCustom', []) - .controller('OvSampleCustomCtrl', - ['$log', '$scope', 'WebSocketService', 'KeyService', - - function (_$log_, _$scope_, _wss_, _ks_) { - $log = _$log_; - $scope = _$scope_; - wss = _wss_; - ks = _ks_; - - var handlers = {}; - $scope.data = {}; - - // data response handler - handlers[dataResp] = respDataCb; - wss.bindHandlers(handlers); - - addKeyBindings(); - - // custom click handler - $scope.getData = getData; - - // get data the first time... - getData(); - - // cleanup - $scope.$on('$destroy', function () { - wss.unbindHandlers(handlers); - ks.unbindKeys(); - $log.log('OvSampleCustomCtrl has been destroyed'); - }); - - $log.log('OvSampleCustomCtrl has been created'); - }]); - -}()); |