How to use the angular-in-memory-web-api.HttpClientInMemoryWebApiModule.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 DeborahK / MovieHunter-routing / src / app / app.module.ts View on Github external
import { AppRoutingModule } from './app-routing.module';

import { AppComponent } from './app.component';
import { ShellComponent } from './home/shell.component';
import { MenuComponent } from './home/menu.component';
import { WelcomeComponent } from './home/welcome.component';
import { PageNotFoundComponent } from './home/page-not-found.component';

/* Feature Modules */
import { UserModule } from './user/user.module';

@NgModule({
  imports: [
    BrowserModule,
    HttpClientModule,
    HttpClientInMemoryWebApiModule.forRoot(MovieData, { delay: 1000, dataEncapsulation: false }),
    UserModule,
    AppRoutingModule
  ],
  declarations: [
    AppComponent,
    ShellComponent,
    MenuComponent,
    WelcomeComponent,
    PageNotFoundComponent
  ],
  bootstrap: [AppComponent]
})
export class AppModule { }
github angular / universal / integration / express-engine-ivy-prerender / src / app / app.module.ts View on Github external
@NgModule({
  declarations: [
    AppComponent,
    PokedexComponent,
    HomepageComponent
  ],
  imports: [
    BrowserModule.withServerTransition({ appId: 'serverApp' }),
    AppRoutingModule,
    HttpClientModule,

    // The HttpClientInMemoryWebApiModule module intercepts HTTP requests
    // and returns simulated server responses.

    HttpClientInMemoryWebApiModule.forRoot(
      PokemonService, { dataEncapsulation: false }
    )
  ],
  providers: [],
  bootstrap: [AppComponent]
})
export class AppModule { }
github DeborahK / Angular-NgRx-GettingStarted / APM-Demo1 / src / app / app.module.ts View on Github external
import { ShellComponent } from './home/shell.component';
import { MenuComponent } from './home/menu.component';
import { WelcomeComponent } from './home/welcome.component';
import { PageNotFoundComponent } from './home/page-not-found.component';

/* Feature Modules */
import { UserModule } from './user/user.module';

/* NgRx */
import { StoreModule } from '@ngrx/store';

@NgModule({
  imports: [
    BrowserModule,
    HttpClientModule,
    HttpClientInMemoryWebApiModule.forRoot(ProductData),
    UserModule,
    AppRoutingModule,
    StoreModule.forRoot({})
    // StoreModule.forRoot({},
    //   {
    //     runtimeChecks: {
    //       strictStateImmutability: true,
    //       strictActionImmutability: true,
    //       strictStateSerializability: true,
    //       strictActionSerializability: true
    //     }
    //   })
  ],
  declarations: [
    AppComponent,
    ShellComponent,
github DeborahK / MovieHunter-communication / MH-5-NgRx / src / app / app.module.ts View on Github external
import { PageNotFoundComponent } from './home/page-not-found.component';

/* Feature Modules */
import { UserModule } from './user/user.module';

/* NgRx */
import { StoreModule } from '@ngrx/store';
import { StoreDevtoolsModule } from '@ngrx/store-devtools';
import { environment } from '../environments/environment';
import { EffectsModule } from '@ngrx/effects';

@NgModule({
  imports: [
    BrowserModule,
    HttpClientModule,
    HttpClientInMemoryWebApiModule.forRoot(MovieData),
    UserModule,
    AppRoutingModule,
    StoreModule.forRoot({}),
    StoreDevtoolsModule.instrument({
      name: 'Movie Hunter DevTools',
      maxAge: 25,
      logOnly: environment.production,
    }),
    EffectsModule.forRoot([])
  ],
  declarations: [
    AppComponent,
    ShellComponent,
    MenuComponent,
    WelcomeComponent,
    PageNotFoundComponent
github johnpapa / angular-ngrx-data / src / client / app / app-dev.module.ts View on Github external
import { NgModule } from '@angular/core';

import { AppModule } from './app.module';
import { AppComponent } from './app.component';

import { HttpClientInMemoryWebApiModule, InMemoryDbService } from 'angular-in-memory-web-api';
import { InMemoryDataService } from '../in-memory-data.service';

@NgModule({
  imports: [
    AppModule,
    // The HttpClientInMemoryWebApiModule module intercepts HTTP requests
    // and returns simulated server responses.
    HttpClientInMemoryWebApiModule.forRoot(InMemoryDataService, {
      dataEncapsulation: false,
      delay: 0,
      passThruUnknownUrl: true
    })
  ],
  providers: [{ provide: InMemoryDataService, useExisting: InMemoryDbService }],
  bootstrap: [AppComponent]
})
export class AppDevModule {}
github RevatureSteve / 1806spark / Drake_Mapel_code / Intro-Angular / angular-tour-of-heroes / src / app / app.module.ts View on Github external
AppComponent,
    HeroesComponent,
    HeroDetailComponent,
    MessagesComponent,
    DashboardComponent,
    HeroSearchComponent
  ],
  imports: [
    BrowserModule,
    FormsModule,
    AppRoutingModule,
    HttpClientModule,
    // The HttpClientInMemoryWebApiModule module intercepts HTTP requests
    // and returns simulated server responses.
    // Remove it when a real server is ready to receive requests.
    HttpClientInMemoryWebApiModule.forRoot(
      InMemoryDataService, { dataEncapsulation: false }
    )
  ],
  providers: [],
  bootstrap: [AppComponent]
})
export class AppModule { }
github DeborahK / MovieHunter-communication / MH-1 / src / app / app.module.ts View on Github external
import { AppRoutingModule } from './app-routing.module';

import { AppComponent } from './app.component';
import { ShellComponent } from './home/shell.component';
import { MenuComponent } from './home/menu.component';
import { WelcomeComponent } from './home/welcome.component';
import { PageNotFoundComponent } from './home/page-not-found.component';

/* Feature Modules */
import { UserModule } from './user/user.module';

@NgModule({
  imports: [
    BrowserModule,
    HttpClientModule,
    HttpClientInMemoryWebApiModule.forRoot(MovieData),
    UserModule,
    AppRoutingModule
  ],
  declarations: [
    AppComponent,
    ShellComponent,
    MenuComponent,
    WelcomeComponent,
    PageNotFoundComponent
  ],
  bootstrap: [ AppComponent ]
})
export class AppModule { }
github wardbell / rxjs-in-ng / src / app / app.module.ts View on Github external
Simplefilms4Component,
    SimpleFilmsComponent,
    SwPeopleComponent,
    SwPeopleFindComponent,
    TakeUntilComponent,
    TakeWhileComponent,
    WhipwheehwComponent,
    WikipediaComponent,
  ],
  imports: [
    BrowserModule,
    OnoffbuttonModule,
    HttpClientModule,
    ReactiveFormsModule,
    HttpClientJsonpModule,
    HttpClientInMemoryWebApiModule.forRoot(InMemoryDataService, {
      passThruUnknownUrl: true
    }),
    RouterModule.forRoot(routes),
    SeNeonModule
  ],
  providers: [
    ButtonbarService,
    GiphyService,
    RakiService,
    SwPeopleService,
    SwUrlService,
    TimeService,
    WikipediaService
  ],
  bootstrap: [AppComponent]
})
github vrnvu / ethereum-voting / src / app / app.module.ts View on Github external
ProposalComponent,
    ProposalDetailComponent,
    MessagesComponent,
    DashboardComponent,
    ProposalSearchComponent,
    AboutComponent,
    ProtocolComponent,
    ProposalFormComponent,
    RecentUpdatesComponent
  ],
  imports: [
    BrowserModule,
    FormsModule,
    AppRoutingModule,
    HttpClientModule,
    HttpClientInMemoryWebApiModule.forRoot(
      InMemoryDataService, { dataEncapsulation: false }
    )
  ],
  providers: [ProposalService, MessageService],
  bootstrap: [AppComponent]
})
export class AppModule { }
github graycoreio / daffodil / libs / state / src / mock / mock.module.ts View on Github external
import { NgModule } from '@angular/core';
import { HttpClientModule } from '@angular/common/http';
import { HttpClientInMemoryWebApiModule } from 'angular-in-memory-web-api';

import { CartTestingModule } from '../cart/testing/cart-testing.module';
import { MockService } from '../mock/services/mock.service';
import { ProductTestingModule } from '../product/testing/product-testing.module';

@NgModule({
  imports: [
    HttpClientModule,
    HttpClientInMemoryWebApiModule.forRoot(MockService),

    ProductTestingModule,
    CartTestingModule
  ]
})
export class MockModule { }