STOMP shared worker: missing vm reference in shared-stomp controller
authorgustavo <gu.martinm@gmail.com>
Sun, 22 May 2016 21:16:38 +0000 (23:16 +0200)
committergustavo <gu.martinm@gmail.com>
Sun, 22 May 2016 21:16:38 +0000 (23:16 +0200)
angularjs/stomp/src/stomp/app/shared-stomp/shared-stomp.controller.js

index 13f7abd..8eb57f0 100644 (file)
@@ -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';
 
 
     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 () {