Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- getRestaurants(): Promise<_Restaurant[]> {
- return this.get("/restaurants").toPromise();
- };
- loadRestaurants = async () => {
- try {
- this.restaurants = await this.restaurantService.getRestaurants();
- } catch (exception) {
- console.log(JSON.stringify(exception, null, 2));
- }
- }
- async getRestaurants(): Promise<_Restaurant[]> {
- try {
- const response: _Restaurant[] = await this.get("/restaurants").toPromise() as _Restaurant[];
- return response;
- } catch (exception) {
- throw new Error(exception);
- }
- };
- loadRestaurants = async () => {
- try {
- this.restaurants = await this.restaurantService.getRestaurants();
- } catch (exception) {
- console.log(JSON.stringify(exception, null, 2));
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement