more login work

This commit is contained in:
2018-05-01 08:20:56 -04:00
parent 8884d1df83
commit cd10c7aaad
22 changed files with 403 additions and 2775 deletions

View File

@@ -1,6 +1,6 @@
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import {HttpClientModule} from '@angular/common/http';
import {HttpClientModule, HTTP_INTERCEPTORS } from '@angular/common/http';
import { ReactiveFormsModule } from '@angular/forms';
import { GamesService } from './games.service';
@@ -29,6 +29,14 @@ import { RegistrationService } from './registration.service';
import { UsernameValidator } from './validators/username.validator'
import { EmailValidator } from './validators/email.validator'
// used to create fake backend
import { fakeBackendProvider } from './_helpers/index';
import { AlertComponent } from './_directives/index';
import { AuthGuard } from './_guards/index';
import { JwtInterceptor } from './_helpers/index';
import { AlertService, AuthenticationService, UserService } from './_services/index';
@NgModule({
@@ -37,7 +45,8 @@ import { EmailValidator } from './validators/email.validator'
GameGridComponent,
ViewCardComponent,
LoginComponent,
RegisterComponent
RegisterComponent,
AlertComponent,
],
imports: [
BrowserModule,
@@ -54,7 +63,25 @@ import { EmailValidator } from './validators/email.validator'
MatPaginatorModule,
MatFormFieldModule
],
providers: [GamesService, RegistrationService, UsernameValidator, EmailValidator],
providers: [
GamesService,
RegistrationService,
UsernameValidator,
EmailValidator,
AuthGuard,
AlertService,
AuthenticationService,
UserService,
{
provide: HTTP_INTERCEPTORS,
useClass: JwtInterceptor,
multi: true
},
// provider used to create fake backend
fakeBackendProvider
],
bootstrap: [AppComponent]
})
export class AppModule { }