davinkevin / AngularStompDK

Angular service to communicate to Stomp-Websocket
http://davinkevin.github.io/AngularStompDK/
Apache License 2.0
36 stars 12 forks source link

Uncaught TypeError: scope.$applyAsync is not a function #39

Closed baczus closed 8 years ago

baczus commented 8 years ago

Hi,

on the latest version (0.9.0) I got following error:

Uncaught TypeError: scope.$applyAsync is not a function
   (anonymous function) @   angular-stomp.js:401
   (anonymous function) @   stomp.js:309

in function $stompSubscribe:

scope.$applyAsync(function () {
   return callback(message);
});

Problem occurs, because empty object for scope is created in function SubscribeBuilder.subscribeTo and because of that this condition if (scope === undefined) in $stompSubscribe is insufficient.

davinkevin commented 8 years ago

I haven't test this way... sorry 😞

Feel free to do a pull request next time 😄

Corrected in 0.9.1

baczus commented 8 years ago

Thanks for quick response :)