How to use the angular-in-memory-web-api.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 gazbert / bxbot-ui-angular / src / app / app.module.ts View on Github external
/**
 * BX-bot UI main module.
 *
 * @author gazbert
 */
@NgModule({
    imports: [
        BrowserModule,
        FormsModule,
        ReactiveFormsModule,
        HttpClientModule,
        HttpModule,

        // Comment line below out to use 'real' bxbot-ui-server Spring Boot backend
        InMemoryWebApiModule.forRoot(InMemoryDataService,  {put204: false, delete404: true}),

        DashboardModule,
        ExchangeModule,
        EmailAlertsModule,
        BotDetailsModule,
        StrategiesModule,
        MarketsModule,
        EngineModule,
        AppRoutingModule,
        LoginModule,
        SettingsModule
    ],
    declarations: [
        AppComponent
    ],
    providers: [
github angular / angular / aio / content / examples / dependency-injection-in-action / src / app / app.module.ts View on Github external
const a_components = [AliceComponent, AlexComponent ];

const b_components = [ BarryComponent, BethComponent, BobComponent ];

const c_components = [
  CarolComponent, ChrisComponent, CraigComponent,
  CathyComponent
];

@NgModule({
  imports: [
    BrowserModule,
    FormsModule,
    HttpModule,
    InMemoryWebApiModule.forRoot(HeroData)
    // AppRoutingModule TODO: add routes
  ],
  declarations: [
    declarations,
    a_components,
    b_components,
    c_components,
  ],
  bootstrap: [ AppComponent ],
  // #docregion providers
  providers: [
    { provide: LocationStrategy, useClass: HashLocationStrategy }
  ]
  // #enddocregion providers
})
export class AppModule { }
github DeborahK / Angular-Routing / APM-Start / src / app / app.module.ts View on Github external
import { ProductData } from './products/product-data';

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

/* Feature Modules */
import { ProductModule } from './products/product.module';
import { UserModule } from './user/user.module';
import { MessageModule } from './messages/message.module';

@NgModule({
  imports: [
    BrowserModule,
    HttpClientModule,
    InMemoryWebApiModule.forRoot(ProductData, { delay: 1000 }),
    ProductModule,
    UserModule,
    MessageModule
  ],
  declarations: [
    AppComponent,
    WelcomeComponent,
    PageNotFoundComponent
  ],
  bootstrap: [AppComponent]
})
export class AppModule { }
github DeborahK / Angular-Routing / APM-Final / src / app / app.module.ts View on Github external
import { AppRoutingModule } from './app-routing.module';
import { AppComponent } from './app.component';
import { WelcomeComponent } from './home/welcome.component';
import { PageNotFoundComponent } from './page-not-found.component';

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

@NgModule({
  imports: [
    BrowserModule,
    BrowserAnimationsModule,
    HttpClientModule,
    InMemoryWebApiModule.forRoot(ProductData, { delay: 1000 }),
    UserModule,
    MessageModule,
    AppRoutingModule
  ],
  declarations: [
    AppComponent,
    WelcomeComponent,
    PageNotFoundComponent
  ],
  bootstrap: [AppComponent]
})
export class AppModule { }
github testing-angular-applications / testing-angular-applications / chapter06 / src / app / app.module.ts View on Github external
PageNotFoundComponent,
    PhoneNumberPipe,
    NewContactComponent,
    ShowContactsDirective
  ],
  entryComponents: [
    ContactFeedDialogComponent,
    InvalidEmailModalComponent,
    InvalidPhoneNumberModalComponent
  ],
  imports: [
    BrowserModule,
    BrowserAnimationsModule,
    FormsModule,
    HttpClientModule,
    InMemoryWebApiModule.forRoot(InMemoryDataService),
    MatDialogModule,
    RoutingModule
  ],
  providers: [
    ContactService,
    ContactFeedService,
    BrowserStorage,
    PreferencesService,
    PreferencesAsyncService
  ],
  bootstrap: [AppComponent]
})
export class AppModule { }
github stbui / angular-material-app / src / app / chat / chat.module.ts View on Github external
import { InMemoryWebApiModule } from 'angular-in-memory-web-api';
import { InMemoryUserDbService } from './data/user';

import { ChatComponent } from './chat.component';
import { UserComponent } from './user/user.component';
import { ContactsComponent } from './contacts/contacts.component';
import { ChatsComponent } from './chats/chats.component';


@NgModule({
  imports: [
    CommonModule,
    FlexLayoutModule,
    MaterialModule.forRoot(),
    RoutingModule,
    InMemoryWebApiModule.forRoot(InMemoryUserDbService)
  ],
  providers: [
    { provide: 'ChatService', useClass: ChatService }
  ],
  declarations: [ChatComponent, UserComponent, ContactsComponent, ChatsComponent]
})
export class ChatModule { }
github Cloud-Player / web / angular-quickstart / app / app.module.ts View on Github external
import { AppComponent }         from "./app.component";
import { HeroDetailComponent }  from './hero-detail.component';
import { HeroesComponent }      from './heroes.component';
import { DashboardComponent }   from './dashboard.component';
import { HeroSearchComponent }  from './hero-search.component';
import { HeroService }          from './hero.service';

import { AppRoutingModule }     from './app-routing.module';

@NgModule({
    imports:      [
        BrowserModule,
        FormsModule,
        HttpModule,
        InMemoryWebApiModule.forRoot(InMemoryDataService),
        AppRoutingModule
    ],
    declarations: [
        AppComponent,
        DashboardComponent,
        HeroDetailComponent,
        HeroesComponent,
        HeroSearchComponent
    ],
    providers: [
        HeroService
    ],
    bootstrap:    [
        AppComponent
    ]
})
github SeeSharply / LearnAngular / src / app / app.module.ts View on Github external
@NgModule({
  declarations: [
    AppComponent,
    ArticleComponent,
    ArticledetailComponent,
    CommentComponent
    
  ],
  imports: [
    BrowserModule,
    FormsModule,
    HttpModule,
    ArticleDetailRoutingModule,
    InMemoryWebApiModule.forRoot(InMemoryDataService),//in memery
    AppRoutingModule

  ],
  providers: [BlogService,CommentService],
  bootstrap: [AppComponent]
})
export class AppModule { }
github wardbell / code-with-us-angular-quickstart / app / final / app.module.ts View on Github external
import { InMemoryDataService }  from './in-memory-data.service';

import { AppComponent }         from './app.component';
import { DashboardComponent }   from './dashboard.component';
import { HeroesComponent }      from './heroes.component';
import { HeroDetailComponent }  from './hero-detail.component';
import { HeroService }          from './hero.service';

import { HeroSearchComponent }  from './hero-search.component';

@NgModule({
  imports: [
    BrowserModule,
    FormsModule,
    HttpModule,
    InMemoryWebApiModule.forRoot(InMemoryDataService),
    AppRoutingModule
  ],
  declarations: [
    AppComponent,
    DashboardComponent,
    HeroDetailComponent,
    HeroesComponent,
    HeroSearchComponent
  ],
  providers: [ HeroService ],
  bootstrap: [ AppComponent ]
})
export class AppModule { }
github Ismaestro / angular8-example-app / app / app.module.ts View on Github external
import { HeroesModule }     from './heroes/heroes.module';

import { InMemoryWebApiModule } from 'angular-in-memory-web-api';
import { InMemoryDataService }  from './shared/in-memory-data.service';

import { AppComponent }     from './app.component';
import { HeroTopComponent } from './heroes/hero-top/hero-top.component';

import './shared/rxjs-extensions';

@NgModule({
    imports: [
        BrowserModule,
        FormsModule,
        HttpModule,
        InMemoryWebApiModule.forRoot(InMemoryDataService),
        AppRoutingModule,
        CoreModule,
        HeroesModule,
        SharedModule
    ],
    declarations: [
        AppComponent,
        HeroTopComponent
    ],
    providers: [
        { provide: APP_CONFIG, useValue: AppConfig }
    ],
    bootstrap: [ AppComponent ]
})

export class AppModule {