- How to use angular-in-memory-web-api
- Understand the basic angular file structure and general angular2 command
Prerequisit: install node.js,npm, angular2
Technology
- Build the new ng project like ng new Tut
- Install the angular-in-memeory-web-api which is the an in-memory web api for Angular demos and tests that emulates CRUD operations over a RESTy API.
- Generate new component: ng generate component one
- Run ng-server to see how the work looks like in the browser in http://localhost:4200
- Create stu-data.ts -fake data
- Create stu.service.ts, the file is about the restful api operations
- Import HttopModule,HttpClientModule,InMemoryWebApiModule in app.module