2
doSelectMessagesAttributesUrl1(pushRequest : PushRequest) {
    console.info("sending post request");

    let headers = new Headers({
        'Content-Type': 'application/x-www-form-urlencoded'});

    return this.http
        .post(this.selectMessagesAttributesUrl, {headers: headers})
        .map(res => res.json().data)
        .subscribe(
            data => { },
            err => { console.error('An error occurred', err) }
        );
}

I get this error:

EXCEPTION: TypeError: this.http.post(...).map is not a functionBrowserDomAdapter.logError @ platform-browser.umd.js:937
zone.js:461 

Unhandled Promise rejection: this.http.post(...).map is not a function ; Zone: <root> ; Task: Promise.then ; Value: TypeError: this.http.post(...).map is not a function(…)

what is missing in my http syntax?

0

1 Answer 1

4

You need to import rxjs like

import 'rxjs/Rx';
Sign up to request clarification or add additional context in comments.

3 Comments

i have this already, and yet i see this error
Be aware this usage of import will drastically increase bundle size
// ----------------- map ----------------------- import 'rxjs/add/operator/map'; import { map } from 'rxjs/operators'; import 'rxjs/Rx'; import { Observable } from 'rxjs'; import 'rxjs/add/observable/throw';

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.