updated to Angular 4 and problems with "rxjs": "^5.0.1",

63 views
Skip to first unread message

Reza Razavipour

unread,
Jun 25, 2017, 12:05:31 PM6/25/17
to Angular and AngularJS discussion
I had to update to Angular 4 from 2 to be able to use some third party controls. I had to also upgrade rxjs package.

I used to have lines such as 
import {Observable} from 'rxjs/Rx';

// Import RxJs required methods
import 'rxjs/add/operator/map';
import 'rxjs/add/operator/catch';

which now cause syntax errors. Where can I now find map and catch?

Or how do I get around this error?

Sander Elias

unread,
Jun 26, 2017, 4:18:36 AM6/26/17
to Angular and AngularJS discussion
Hi Rezza,

That is exactly how I do it in my project. I have no syntax errors like that.
If you are using systemJS, there might be a configuration issue.

Regards
Sander

Reza Razavipour

unread,
Jun 26, 2017, 11:48:02 AM6/26/17
to ang...@googlegroups.com
I am reading on the documentation that the following is the way to use the rxjs stuff....
// import observable
import { Observable } from 'rxjs/Observable';

// import operators
import 'rxjs/add/observable/map';
import 'rxjs/add/operator/catch';

this is the error message:


and my package.json has

"dependencies": {
"@angular/animations": "^4.0.0",
"@angular/common": "4.0.0",
"@angular/compiler": "4.0.0",
"@angular/compiler-cli": "4.0.0",
"@angular/core": "4.0.0",
"@angular/forms": "4.0.0",
"@angular/http": "4.0.0",
"@angular/platform-browser": "4.0.0",
"@angular/platform-browser-dynamic": "4.0.0",
"@angular/platform-server": "4.0.0",
"@angular/router": "4.0.0",
"ag-grid": "^10.1.0",
"ag-grid-angular": "^10.1.0",
"bootstrap": "^3.3.6",
"core-js": "^2.4.1",
"jquery": "^3.1.1",
"lodash": "^4.17.3",
"moment": "^2.17.1",
"rxjs": "^5.4.1",
"systemjs": "0.19.27",
"zone.js": "^0.8.4"
},
"devDependencies": {
"lite-server": "^2.2.2",
"typescript": "^2.1.4"
}




Regards,
Reza

--
You received this message because you are subscribed to a topic in the Google Groups "Angular and AngularJS discussion" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/angular/uDurlMFIxeQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to angular+unsubscribe@googlegroups.com.
To post to this group, send email to ang...@googlegroups.com.
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Sander Elias

unread,
Jun 26, 2017, 10:58:22 PM6/26/17
to Angular and AngularJS discussion
Hi Reza,

You package looks good to me, but it is probably the systemjs config where you have to set how to load your operators. As it looks now, it tries to load those from flowsheet.js

Regards
Sander
Reply all
Reply to author
Forward
0 new messages