February 2019
Intermediate to advanced
446 pages
10h 55m
English
On component load, the getRestaurant method is called using the ngOnInit method. The restaurant ID, which is passed as a part of the route value on the restaurant list page, is fetched by subscribing to the ActivatedRoute instance parameters.
The default date is set to tomorrow, and the maximum date is set to today +180 days. Similarly, the default time is set to 1:00 PM.
The Book() method performs the reservation by calling the performBooking() method of the REST client Angular service:
import { Component, OnInit } from '@angular/core';import { ActivatedRoute, Router, RouterStateSnapshot } from '@angular/router';import { faCalendar } from '@fortawesome/free-regular-svg-icons'; ...Read now
Unlock full access