GetUserDetailsById(Id): Observable<userdetails> {
return this.httpclient.get(this.BaseURI + '/user/UserDetailsById/' + Id).map((response: Response) => <userdetails>response.json())
}
1. constructor(private httpclient: HttpClient)
2. export class userdetails
{
idUser: number;
firstName: string;
lastName: string;
email: string;
permissions: string;
isActive: boolean;
displayRole: number;
}
Getting error while removing .map((response: Response) => response.json())
Error : Type Observable<Object> is not assignable to type Observable I dont want to use .map((response: Response) => response.json()) Any suggestions? This above code is working fine when using with this.http
example :
return this.http.get(this.BaseURI + '/user/UserDetailsById/' + Id).map((response: Response) => response.json())
- constructor(private http: Http)