Angular 6 HTTP App
This is a demo app for ng-book that demonstrates how to use the HttpClient Module. The app requires access to jsonplaceholder.typicode.com API to function. The app can also be configured to use a local json-server.
This project was generated with Angular CLI version 6.0.7.
- Clone repository
- Start app with
- Navigate to
http://localhost:4200/. The app will automatically reload if you change any of the source files.
Take note that the responses returned by the online REST service are fake i.e. data won't actually be persisted.
To run locally, install the following
npm install -g json-server
Start the json-server first:
json-server --watch data/db.json. Then start the Angular app using a local environment like this
ng serve -c local. This will make the application use data from the local json-server API. In this mode, data will be persisted in the
The MIT License (MIT) Copyright (c)
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.