Skip to content

Instantly share code, notes, and snippets.

@MrCube42
Created March 28, 2020 12:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MrCube42/7c5a205209c5c66d2c7384968da5cc6d to your computer and use it in GitHub Desktop.
Save MrCube42/7c5a205209c5c66d2c7384968da5cc6d to your computer and use it in GitHub Desktop.
Angular-Service, der über eine REST API die interessanten Bekannten in der Nähe, zur Darstellung in der Client-App, zurückliefert.
export class CompanionsService {
constructor(private http: HttpClient) {}
public getAll(): Observable<Companion[]> {
const url = `${BASE_URL}/companions`;
return this.http.get<Companion[]>(url);
}
// ...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment