import { Injectable } from '@angular/core' ; import { HttpClient } from '@angular/common/http' ; import { Observable } from 'rxjs' ; import { Brand } from 'src/app/models/brand/brand' ; 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 BrandService { constructor ( private httpClient ) { } apiUrl = environment . apiUrl ; getBrand ( ) { return this . httpClient . get < ListResponseModel < Brand > > ( this . apiUrl + 'brands/getall' ) ; } add ( brand ) { return this . httpClient . post < ResponseModel > ( this . apiUrl + 'brands/add' , brand ) ; } }