import { HttpClient } from '@angular/common/http' ; import { Injectable } from '@angular/core' ; import { Observable } from 'rxjs' ; import { Color } from 'src/app/models/color/color' ; import { ListResponseModel } from 'src/app/models/listResponseModel' ; import { ResponseModel } from 'src/app/models/responseModel' ; import { environment } from 'src/environments/environment' ; @ Injectable ( { providedIn : 'root' , } ) export class ColorService { constructor ( private httpClient ) { } apiUrl = environment . apiUrl ; getColor ( ) { return this . httpClient . get < ListResponseModel < Color > > ( this . apiUrl + 'colors/getall' ) ; } add ( color ) { return this . httpClient . post < ResponseModel > ( this . apiUrl + 'colors/add' , color ) ; } }