How to use the angular-in-memory-web-api/in-memory-web-api.module.InMemoryWebApiModule.forRoot function in angular-in-memory-web-api

To help you get started, we’ve selected a few angular-in-memory-web-api examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github thomsonreuters / FEF / ng-rosetta / fruit20 / src / app / app.module.ts View on Github external
// The AppModule serves to combine our various comsponents, services and models into a discreet module.
// All required references are imported above, and then referenced as follows:
// imports: External modules that will be consumed by AppModule.
// declarations: Internal Components and Directives that will be consumed by the rendering engine.
// providers: Internal Services and Resolvers that will be consumed the the Dependency Injection engine.
// bootstrap: The Component to display first.
@NgModule({
  imports: [
    BrowserModule,
    FormsModule,
    NgbModule.forRoot(),
    HttpModule,
    // Note that we are using an In Memory Database Service to serve our data to our service.
    // We configure the starting point for the service here.
    // Note that this service must be imported *after* the HttpModule to allow it to attach it's interceptors to the Http service.
    InMemoryWebApiModule.forRoot(InMemoryDataService, {passThruUnknownUrl: true}),    
    appRouting
  ],
  declarations: [
    AppComponent,
    HomeComponent,
    FruitListComponent,
    FruitDetailComponent,
    FruitItemImageComponent,
    FruitImageCellComponent
  ],
  providers: [
    FruitService,
    FruitDetailResolver
  ],
  bootstrap: [ AppComponent ]
})