| Start |
|---|
| Setting Up Multiple Test API Routes mock-data.ts Now, you can interact with both app/mockand app/datato extract their corresponding data. |
| Basic Setup mock-data.ts Create the mock api data main.ts Have the dependency injector provide the InMemoryBackendService for XHRBackend requests. Also, provide a class that includes a createDb()function (in this case, MockData) specifying the mocked API routes for SEED_DATA requests. mock.service.ts Example of calling a get request for the created API route RemarksI mainly requested this topic because I could not find any information on setting up multiple API routes with the Angular2-In-Memory-Web-Api. Ended up figuring it out myself, and figured this might be helpful to others. |
Read Article
https://develop.horje.com/learn/1434/reference