Git Product home page Git Product logo

Comments (19)

oarshad avatar oarshad commented on July 23, 2024 1

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.

kum-deepak avatar kum-deepak commented on July 23, 2024

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.

kum-deepak avatar kum-deepak commented on July 23, 2024

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.

oarshad avatar oarshad commented on July 23, 2024

First one worked. Didn't try the second set.

from ng2-stompjs.

kum-deepak avatar kum-deepak commented on July 23, 2024

Thanks!

from ng2-stompjs.

janwytze avatar janwytze commented on July 23, 2024

@kum-deepak Could the branch dyna be merged to master?

from ng2-stompjs.

kum-deepak avatar kum-deepak commented on July 23, 2024

Merged! I will wait for some more feedback before releasing a new NPM version.

from ng2-stompjs.

kum-deepak avatar kum-deepak commented on July 23, 2024

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.

janwytze avatar janwytze commented on July 23, 2024

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.

ma-jahn avatar ma-jahn commented on July 23, 2024

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.

kum-deepak avatar kum-deepak commented on July 23, 2024

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"]
    },

See: (https://github.com/stomp-js/ng5-stompjs-demo/blob/3594c458f98e7c4523b7d274c6dbf94e600f2c8c/src/tsconfig.app.json#L7)

This is needed, most likely, because this library is distributed as ts files.

from ng2-stompjs.

ma-jahn avatar ma-jahn commented on July 23, 2024

Thank you so much! This is working just fine.

from ng2-stompjs.

janwytze avatar janwytze commented on July 23, 2024

Thanks, is there a way to include it in this package? I will try to find one

from ng2-stompjs.

kum-deepak avatar kum-deepak commented on July 23, 2024

@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.

janwytze avatar janwytze commented on July 23, 2024

That's sad. It's not a very big problem, only one extra step.

from ng2-stompjs.

kum-deepak avatar kum-deepak commented on July 23, 2024

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.

kum-deepak avatar kum-deepak commented on July 23, 2024

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.

kum-deepak avatar kum-deepak commented on July 23, 2024

If no further issue reported, I will close this issue in few days.

from ng2-stompjs.

muhammad-Usman85 avatar muhammad-Usman85 commented on July 23, 2024

i added this one and it fixed my problem
->npm i @stomp/ng2-stompjs

from ng2-stompjs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.