Try using this structure:
this.AuthService.loginAuth(this.data).subscribe( suc => { console.log(suc); }, err => { console.log(err ); } );
In addition, you may need to strengthen your data sent to the server, for example:
loginAuth(data) { var headers = new Headers(); headers.append('Content-Type', 'application/json'); var info = JSON.stringify(data); return this._http.request("http://192.168.2.122/bapi/public/api/auth/login", info , { headers: headers }).map(res => res.json()) }
And you should declare a variable in the constructor of your service, referring to Http, for example:
import { Http, Headers, Response, URLSearchParams } from '@angular/http'; constructor(private _http: Http) { }
Here's how it worked for me
source share