From: gustavo Date: Sun, 22 May 2016 21:16:38 +0000 (+0200) Subject: STOMP shared worker: missing vm reference in shared-stomp controller X-Git-Url: https://git.gumartinm.name/?a=commitdiff_plain;h=9b20bff43bbc79137c03c92108862e0fdbc06632;p=JavaScriptForFun STOMP shared worker: missing vm reference in shared-stomp controller --- diff --git a/angularjs/stomp/src/stomp/app/shared-stomp/shared-stomp.controller.js b/angularjs/stomp/src/stomp/app/shared-stomp/shared-stomp.controller.js index 13f7abd..8eb57f0 100644 --- a/angularjs/stomp/src/stomp/app/shared-stomp/shared-stomp.controller.js +++ b/angularjs/stomp/src/stomp/app/shared-stomp/shared-stomp.controller.js @@ -24,7 +24,6 @@ function SharedStompController($location, sharedWorker) { var vm = this; - vm.url = $location.protocol() + '://' + $location.host() + '/spring-stomp-server-full/fullportfolio'; vm.clientDestination = '/topic/greeting'; vm.serverDestination = '/app/greeting'; @@ -46,11 +45,11 @@ vm.connect = function () { - sharedWorker.connect(JSON.parse(connectHeaders), connectSuccessCallback, connectErrorCallback); + sharedWorker.connect(vm.url, JSON.parse(vm.connectHeaders), connectSuccessCallback, connectErrorCallback); }; vm.subscribe = function () { - sharedWorker.subscribe(clientDestination, subscribeCallback, JSON.parse(subscribeHeaders)); + sharedWorker.subscribe(vm.clientDestination, subscribeCallback, JSON.parse(subscribeHeaders)); }; vm.unSubscribe = function () {