Skip to content

Instantly share code, notes, and snippets.

@jplemieux66
Created June 9, 2018 15:37
Show Gist options
  • Save jplemieux66/69a8d090ee5accf88445a4ac66cffc57 to your computer and use it in GitHub Desktop.
Save jplemieux66/69a8d090ee5accf88445a4ac66cffc57 to your computer and use it in GitHub Desktop.
import { HttpClient } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { Observable } from 'rxjs';
import { ProjectsDetails } from '../../../shared/model/user-projects-details';
import { createCommonHeaders } from '../../utils/httpHeaderUtils';
import { ProjectsModule } from '../projects.module';
@Injectable({
providedIn: ProjectsModule,
})
export class ProjectsService {
constructor(private http: HttpClient) { }
loadProjectsDetails(userId): Observable<ProjectsDetails> {
return <Observable<ProjectsDetails>>this.http.get('/api/projects', { headers: createCommonHeaders(userId)});
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment