beevelop / ng-stomp Goto Github PK
View Code? Open in Web Editor NEW:bookmark_tabs: STOMP for AngularJS
Home Page: http://beevelop.github.io/stomp-ui/
License: MIT License
:bookmark_tabs: STOMP for AngularJS
Home Page: http://beevelop.github.io/stomp-ui/
License: MIT License
This nice library depends on a highly out-dated version of socksJS "sockjs": "0.3.4"
. The current version is 1.0.3
.
For example, this nasty issue is present in the old sockjs library: sockjs/sockjs-client#305
PS: I just tested ng-stomp with sockjs 1.0.3 and all seems to work fine.
var subscription = $stomp.subscribe('/queue/' + user.id + '/interviews/1', function (payload, headers, response) {
console.log(headers)
console.log(response)
console.log(payload)
$scope.ss = 'sf' // here !!!!!
}, {});
I update the variables in the callback, but the view has no update to reflect the change.
I am getting the following error on close in production
min-bower-20180201_224511-57e1187.js:136 Error: InvalidStateError: The connection has not been established yet
at d.send (min-bower-20180201_224511-57e1187.js:21168)
at b._transmit (min-bower-20180201_224511-57e1187.js:21169)
at b.disconnect (min-bower-20180201_224511-57e1187.js:21170)
at Object.disconnect (min-bower-20180201_224511-57e1187.js:21177)
at websocketService.disconnect (min-app-20180201_224511-57e1187.js:28986)
at min-app-20180201_224511-57e1187.js:28856
at m.$emit (min-bower-20180201_224511-57e1187.js:164)
at onClose (min-app-20180201_224511-57e1187.js:492)
at d.sock.onclose (min-app-20180201_224511-57e1187.js:499)
at d.c.dispatchEvent (min-bower-20180201_224511-57e1187.js:21168)
Just a minor bug found. When we minify and combine all our dependencies into one file, we found that we get an error saying 'Undefined is not a function', etc.
I believe all that needs to be done to fix this is to add '();' to the very end of the file.
how to set heart-beat value in headers ?
ex - headers ={ login:"",passcode:"",heart-beat:"20000,50000"}
not work for me.
Now, you can't know if the underlying connection is closed.
Line 31 in a20f132
Please update above new SockJS()
to new WebSocket()
because new rabbitmq version its not connected using new SockJS()
and also update endpoint to ws://127.0.0.1:15674/ws
this.sock = new WebSocket(endpoint, null, sockjsOpts)
https://github.com/jmesnil/stomp-websocket
The original repo is not maintained. There is an active fork here: https://github.com/stomp-js/stomp-websocket
Using "ng-stomp": "0.5.0" in my package.json file with the ng-stomp standalone via bower, I always get the following exception, Any solution?
Uncaught SyntaxError: JSON.parse
at Object.function.JSON.parse.JSON.parse (ng-stomp.standalone.min.js:24)
at c.XHRLocalObject.f.onfinish (ng-stomp.standalone.min.js:24)
at c.XHRLocalObject.f.emit (ng-stomp.standalone.min.js:24)
at XMLHttpRequest.g.xhr.onreadystatechange (ng-stomp.standalone.min.js:24)
In the readme.md
file you reference <script src="/bower_components/stompie/stompie.min.js"></script>
. stompie is not included as a dependency when I install the code via bower. Can you update the documentation?
I am experiencing this error when run unit test. (Karma, jasmine)
Anyone have similar issue?
-----update------
It turns out that bower install seems have old source code.
When an error occurs during the connection ng-stomp correctly reject the promise but also try to call the undefined function errorCallback (line 37). Before calling that function should be checked if it is defined or not.
Hi @beevelop
First of all , this is not a issues. i just want to know about how to configure stomp endpoint i.e ( http://127.0.0.1:8080/stomp ) over nginx server if you konw.
Hi,
I've got following simple scenario / problem:
On application start I call .connect(..)
at global scope, because I just need a single Stomp Connection for the whole application.
At the same time Angular loads the first controller. And this controller needs to call .subscribe(..)
and .send(..)
.
The problem is, that the connection takes some time to get established, but the controller code is running before .connect(..)
has finished. And then It'll throw some Error.
In your example you use .connect(..).then(..)
, but of course that's not possible, when calling .connect(..)
at global scope. Or is it possible to call .connect(..).then(..)
multiple times without creating multiple connections?
So it would be really nice to have some callbacks from you library, so I can call .connect(..)
somewhere at application start. And then do something like $stomp.onConnect(function(success) { if(success) { $stomp.subscribe(..) } });
or maybe use some promise for that.
Or maybe there's some other solution? Thank you!
I am using this file and download using bower and it cause error in console and my project stopped working; after debugging for 5 hours I found that semicolon is missing in it's ng-stomp.js fie.
can you please add semicolon in end of the function or suggest me how do I use it and add semicolon while copying these JS file from gulp serve:dist
I'm getting the "The URL's scheme must be either 'http:' or 'https:'. 'wss' is not allowed." error.
Is there anyway to use wss?
Thanks in advance.
Johan
Hi,
Can you add the sockjs options
parameter to the $stomp.connect()
function?
From https://github.com/sockjs/sockjs-client#sockjs-client-api the constuctor has a 3rd parameter - options:
var sockjs = new SockJS(url, _reserved, options);
I'm interested in using the options
parameter with ng-stomp
to restrict transports to the ones that are implemented on the server.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.