Angular 22 · Signals and services

Fetch data over HTTP

Request JSON with HttpClient, which returns an observable. Provide it with provideHttpClient().

private http = inject(HttpClient);

getUsers() {
  return this.http.get<User[]>('/api/users');
}

Official Angular 22 documentation

More signals and services commands

All signals and services commands · Angular 22 cheatsheet

Was this page helpful?