I'm using the angular2 in-memory-web-api for development. For the production environment I want to disable the in-memory-web-api and my real API to be used. Is there some way to disable the InMemoryWebApiModule for production?
This simple approach works for me:
const ENV = 'prod'; // your global ENV variable;
-----
@NgModule({
  imports: [
    ...
    HttpModule,
    ENV !== 'prod' ? InMemoryWebApiModule.forRoot(DataMockService) : [],
  ],
  ...
})
export class AppModule {}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With