Comments (19)
It compiles after changing the following line:
import {Observable, Observer, Subscription} from 'rxjs/Rx';
with these:
import {Observable} from 'rxjs/Observable'; import {Observer} from 'rxjs/Observer'; import {Subscription} from 'rxjs/Subscription';
from ng2-stompjs.
I will give Angular 5 a shot in few days. Meanwhile if you get additional errors, you might also need to import few operators. The imports might look like:
import { BehaviorSubject } from 'rxjs/BehaviorSubject';
import { Observable } from 'rxjs/Observable';
import { Observer } from 'rxjs/Observer';
import { Subject } from 'rxjs/Subject';
import { Subscription } from 'rxjs/Subscription';
import 'rxjs/add/operator/filter';
import 'rxjs/add/operator/share';
from ng2-stompjs.
Or may be:
import { BehaviorSubject } from 'rxjs/BehaviorSubject';
import { Observable } from 'rxjs/Observable';
import { Observer } from 'rxjs/Observer';
import { Subject } from 'rxjs/Subject';
import { Subscription } from 'rxjs/Subscription';
import { filter, share } from 'rxjs/operators';
Please let me know if any of the above or something else actually works.
from ng2-stompjs.
First one worked. Didn't try the second set.
from ng2-stompjs.
Thanks!
from ng2-stompjs.
@kum-deepak Could the branch dyna
be merged to master
?
from ng2-stompjs.
Merged! I will wait for some more feedback before releasing a new NPM version.
from ng2-stompjs.
I am trying to use this library unsuccessfully with Angular 5, it will be great if you can share a working sample with Angular 5.
from ng2-stompjs.
I've added "@stomp/ng2-stompjs": "github:stomp-js/ng2-stompjs",
. to my package.json, so I got the newest version. But I still get the same error.
from ng2-stompjs.
Hi,
i am using Angular 5 along with RXJS 5.5.2.
After changing the imports of stomp.service.ts to
import { BehaviorSubject } from 'rxjs/BehaviorSubject';
import { Observable } from 'rxjs/Observable';
import { Observer } from 'rxjs/Observer';
import { Subject } from 'rxjs/Subject';
import { Subscription } from 'rxjs/Subscription';
import 'rxjs/add/operator/filter';
import 'rxjs/add/operator/share';
I get the index.ts is not part of the compilation output error.
When changing the imports of stomp.service.ts to
import { BehaviorSubject } from 'rxjs/BehaviorSubject';
import { Observable } from 'rxjs/Observable';
import { Observer } from 'rxjs/Observer';
import { Subject } from 'rxjs/Subject';
import { Subscription } from 'rxjs/Subscription';
import { filter, share } from 'rxjs/operators';
i see the following Error:
ERROR in node_modules/@stomp/ng2-stompjs/src/stomp.service.ts(77,8): error TS2339: Property 'filter' does not exist on type 'BehaviorSubject'.
@oarshad : Which version of rxjs are you using?
from ng2-stompjs.
I have now been able to create a working version with Angular 5. The sample is at: https://github.com/stomp-js/ng5-stompjs-demo
Created a new Angular 5 project using latest Angular CLI and placed (only) the relevant code files from Angular 4 version of the demo. Added bootstrap
(needed for the CSS).
What changes I did:
- A minor change in the library code (now committed in the master branch).
- Important - in
src/tsconfig.app.json
placed the following:
"paths": {
"@stomp/ng2-stompjs": ["../node_modules/@stomp/ng2-stompjs"]
},
This is needed, most likely, because this library is distributed as ts files.
from ng2-stompjs.
Thank you so much! This is working just fine.
from ng2-stompjs.
Thanks, is there a way to include it in this package? I will try to find one
from ng2-stompjs.
@jwz104 the issue is that I have not been able to reliably package this library as compiled JS files. Once that is done this step will not be needed. We can collaborate on #38
from ng2-stompjs.
That's sad. It's not a very big problem, only one extra step.
from ng2-stompjs.
Please use this library from angular5
branch as of now.
I am cleaning up the underlying js library https://github.com/stomp-js/stomp-websocket (branch v4)
from ng2-stompjs.
All the required changes has been merged and version 0.6.1 been released. This is compiled JS release, so, no manual steps should be needed.
from ng2-stompjs.
If no further issue reported, I will close this issue in few days.
from ng2-stompjs.
i added this one and it fixed my problem
->npm i @stomp/ng2-stompjs
from ng2-stompjs.
Related Issues (20)
- set brokerURL through API Call HOT 4
- Error during WebSocket handshake: Sent non-empty 'Sec-WebSocket-Protocol' header but no response was received HOT 4
- Disconnect and Reconnect with RxStopService HOT 1
- Multiple connection HOT 5
- publish doesn't exist, "@stomp/ng2-stompjs": "^8.0.0", HOT 1
- Problems receiving messages! Angular 9 HOT 1
- An accessor cannot be declared in an ambient context. HOT 2
- Websocket Connection not Establishing until Browser Refresh HOT 7
- WS not reconnecting after wifi is turned off and on. HOT 1
- Facing issue as ng2-stompjs based websocket connection is closed for a specific json object structure. It is possibly an issue with parsing of json object. HOT 3
- Stop connection attempt after x attempts
- Mock RxStompService connect method HOT 2
- No message provided to error "WebSocket connection to url failed: "
- Client stops sending heart beat outgoing packets HOT 6
- Updating the brokerUrl of existing connections HOT 2
- "Encourage the library authors to publish an Ivy distribution." HOT 8
- Unsure on how to provide brokerURL after constructor HOT 2
- Angular 14 support HOT 3
- Unable to send text messages to activemq.
- Not working in angular 15. Error: Failed to initialize Angular compilation - Failed to compile entry-point @stomp/ng2-stompjs HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ng2-stompjs.