HTTP Client
HttpClient does AJAX. this.http.get<Student[]>('/api/marks').subscribe(rows => this.students = rows). provideHttpClient() in app config (or HttpClientModule on older apps).
Always handle error: catchError → user message. Don’t leave subscribe(err) empty. Unsubscribe or use async pipe / takeUntilDestroyed so you don’t setState after destroy.
Trap: putting the URL string in ten components. Keep it in the service. Another trap: JSON.parse on an already-parsed body.
Exam tip
get in a service + error + no leak after destroy.