import { Injectable } from '@angular/core';
import { HttpClient, HttpHeaders } from '@angular/common/http';
import { Observable } from 'rxjs/Observable';
import { Category } from '../core/entities';
import { environment } from '../../environments/environment';

const CATEGORY_URL = environment.apiUrl + '/api/categories/';
@Injectable()
export class HeaderService {

	constructor(private http: HttpClient) {}

	getAllCategories(): Observable<Array<Category>> {
		return this.http.get<Array<Category>>(CATEGORY_URL);
	}
}
