February 2019
Intermediate to advanced
446 pages
10h 55m
English
The restaurants component will use the rest.service we created earlier to call the REST APIs we developed in previous chapters.
Modifications to restaurants.component.ts are shown in the following code block in bold. A service instance is created inside the constructor and is then used in the getRestaurants and searchRestaurants methods to fetch the requested data. ngOnIt is called when the component is being loaded. Therefore, it is modified to add the call to getRestaurants(), which loads the restaurants list, and when the component is rendered, it displays the restaurant's ...
Read now
Unlock full access