Verify the Angular 21 code practices updation
Ref: https://notes.prateekkumar.site/angular-21-practices-audit.html
1. Replace HttpClientModule with provideHttpClient(withFetch(), withInterceptors(...)). Convert the two interceptors to functions.
What it can affect
- Every
HttpClientcall. Network Type should befetch, notxhr. - Logged-in API calls.
authorizationstill has to show up onusers/andpost/requests. - 401 refresh. Poison
fm_user, keepfm_over. You should seePUT users/users/refresh-token, then the original call with a new token. - 403 logout, private-content 400,
/user_by_usernamesuspend/private, and/users/users?host_namecreator logout. - The subscription-plan call that uses
skipInterceptor=true. - SSR and prerender HTTP. Fetch is the server path. An XHR error on the server means this did not take.
- Upload percent bars on lesson video, post image, merch, and the other
reportProgressflows. Fetch does not emit upload percent. The file can still land. The bar can sit at 0 and then jump. - Selects that load options from a URL or a JSON file.