Ho guardato tutte le questioni GitHub, ei posti StackOverflow, ma sono in grado di farlo funzionareAngular2 - http.post (...) mappa non è una funzione
(. https://github.com/angular/angular/issues/5632)
(Angular 2 HTTP GET with TypeScript error http.get(...).map is not a function in [null])
- sto usando [email protected]
- Rxjs ([email protected]) è importato con successo quando controllo console/risorse in console.
ho provato diverse importazioni:
import 'rxjs/add/operator/map';
import 'rxjs/rx';
Ma io continuo a ricevere l'errore http.post(...).map is not a function
aggiornamento - contesto codice
let body = "email=" + email + "&password=" + password;
let headers = new Headers();
headers.append('Content-Type', 'application/x-www-from-urlencoded');
this.http.post('http://angular.app/api/v1/auth') // angular.app is laravel backend
.map((responseData) => {
return responseData.json();
})
Potrebbe darci Moure dettagli sul codice intorno al vostro Chiamata HTTP? Grazie! –
@ThierryTemplier vedi il mio aggiornamento –
Grazie! Aggiungi 'HTTP_PROVIDERS' quando chiamate la funzione' bootstrap'? –