xxxxxxxxxx
// user.service.ts
import { Injectable } from '@angular/core';
import { HttpClient } from '@angular/common/http';
import { Observable } from 'rxjs';
@Injectable({
providedIn: 'root',
})
export class UserService {
private apiUrl = 'https://jsonplaceholder.typicode.com/users';
constructor(private http: HttpClient) {}
getUsers(): Observable<any> {
return this.http.get(this.apiUrl);
}
}
xxxxxxxxxx
import { HttpClient } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { GET_ALL_PROJECT_ROUTE } from 'src/constants';
@Injectable({
providedIn: 'root',
})
export class ApiService {
constructor(private http: HttpClient) {}
getProjects() {
return this.http.get(GET_ALL_PROJECT_ROUTE);
}
}
xxxxxxxxxx
just type this ,
->headerActions([
ExportAction::make()->exporter(ProductExporter::class)->disabled(Product::count() === 0)
])