Submodule 22.3: Angular HTTP Client - Practice
The results
With the previous code configured, open your Terminal, go to the jsonServer
sub-folder and run json-server --watch db.json -d 2000
. This will introduce a delay of 2 seconds before the server sends the reply for the request. The server will serve the db.json file for your application. You can watch the server in your browser URL localhost:3000
Open another Terminal window, go to the angularChocoYourname
angular-sub-folder and run ng serve
to run your application in development mode. In your browser navigate to the URL localhost:4200
The menu page has been server by the json-server. If you stop the server, there is not content available to the page. In contrast, the about page takes the data by the application, so this is not affected by the server.
In the next assignment, you will enable the server to serve the about page.
Do a Git commit with the message "Angular HttpClient".