Using Angular HttpClient
Revision as of 10:35, 24 October 2019 by PeterHarding (talk | contribs) (Created page with "=Links= * * =Examples= Some examples. ==GET== <pre> getUsers() { this.httpClient.get(this.url').subscribe((res: any[]) => { console.log(res); this....")
Links
Examples
Some examples.
GET
getUsers() {
this.httpClient.get(this.url').subscribe((res: any[]) => {
console.log(res);
this.users = res;
},
error => { this.errorMessage = error as any; },
() => {
// Complete - update a datatable
this.changeDetectorRef.detectChanges();
const table: any = $('#UsersTable');
this.dataTable = table.DataTable(this.dtOptions);
});
} // getUsers