Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

421
Views
Angular: how set "priority" to HttpClient

Priority hints indicate the relative priority of resources to the browser. They can enable optimal loading and improve Core Web Vitals.

From https://web.dev/priority-hints/

example with fetch API:

<script>
  fetch('https://example.com/', {priority: 'low'})
  .then(data => {
    // Trigger a low priority fetch
  });
</script>

how set "priority" to Angular HttpClient?

I have tried to force a priority setting:

import { HttpClient } from '@angular/common/http';
import { Component, OnInit } from '@angular/core';

@Component({
  selector: 'my-app',
  template: `
  <button (click)="makeRequest()">make request</button><br />
  <pre>{{ data | json }}</pre>`,
})
export class AppComponent implements OnInit {
  data: any;

  constructor(private httpClient: HttpClient) {}

  ngOnInit(): void {
    this.makeRequest();
  }

  makeRequest() {
    this.data = null;
    this.httpClient
      .get('https://jsonplaceholder.typicode.com/todos/1', {
        priority: 'low',
      } as any)
      .subscribe((result) => (this.data = result));
  }
}

online

but doesn't works... priority is always hight

also suggested to angular team https://github.com/angular/angular/issues/45426

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

You can use like below:

this.http.get<YourConfig>(this.yourConfigUrl, {priority: 'low'});
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!