Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import { Injectable } from '@angular/core';
- import { HttpClient, HttpHeaders , HttpParams } from '@angular/common/http';
- import { User } from '../models/user';
- import { tap, map } from 'rxjs/operators';
- import { Car } from '../models/car';
- @Injectable({ providedIn: 'root' })
- export class UserService {
- headers = new HttpHeaders({
- 'Content-Type': 'application/json',
- 'Authorization': 'application/json'
- });
- host = 'http://localhost:8080/';
- constructor(private http: HttpClient) { }
- getUser(userId:number){
- let params = new HttpParams().set('userId', String(userId));
- let options = { headers: this.headers, params: params };
- return this.http.get(this.host + 'getUserById', options);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement