import { HttpClient } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { Observable } from 'rxjs';
import { TypeEq } from '../models/typeeq.model';

@Injectable({ providedIn: 'root' })
export class TypeEqService {
    // addType(modelType: Function) {
    //   throw new Error('Method not implemented.');
    // }

    constructor(private http: HttpClient) { }
    url: string = "http://0eb9-110-169-220-190.ngrok.io";
    listType: TypeEq[] = []

    addTypeEq(model: TypeEq) {
        console.log("type", model)
    this.http.post(this.url + "/typeeq/", model).subscribe(response => {
      console.log(response);

    })
    }

    getListTypeEq(): Observable<TypeEq[]> {
        return this.http.get<TypeEq[]>(this.url + "/typeeq/lists");
    }
    
}
