Skip to content

Instantly share code, notes, and snippets.

@elvinmeza
Created November 21, 2017 16:49
Show Gist options
  • Save elvinmeza/cd49a286bffedbdd6de99e1d5939f955 to your computer and use it in GitHub Desktop.
Save elvinmeza/cd49a286bffedbdd6de99e1d5939f955 to your computer and use it in GitHub Desktop.
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { HttpClientModule, HTTP_INTERCEPTORS } from '@angular/common/http';
import { HttpClientInMemoryWebApiModule } from 'angular-in-memory-web-api';
import { AppComponent } from './app.component';
import { InMemoryDataService } from './services/in-memory-data.service';
import { AuthInterceptor } from './shared/auth-interceptor';
import { RockBand } from './services/rock-bands.service';
@NgModule({
declarations: [
AppComponent
],
imports: [
BrowserModule,
HttpClientModule,
HttpClientInMemoryWebApiModule.forRoot(
InMemoryDataService, { dataEncapsulation: false }
)
],
providers: [
{
provide: HTTP_INTERCEPTORS,
useClass: AuthInterceptor,
multi: true
},
RockBand
],
bootstrap: [AppComponent]
})
export class AppModule { }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment