Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
59 lines (55 sloc) 1.74 KB
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { AppComponent } from './app.component';
import { NoteListComponent } from './note-list/note-list.component';
import { NoteService } from './shared/note/note.service';
import { RouterModule, Routes } from '@angular/router';
import { OktaAuthGuard, OktaAuthInterceptor, OktaAuthService } from './shared/okta';
import {
MatButtonModule,
MatCardModule,
MatIconModule,
MatInputModule,
MatListModule,
MatToolbarModule
} from '@angular/material';
import { NoteDetailComponent } from './note-detail/note-detail.component';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { FormsModule } from '@angular/forms';
import { HTTP_INTERCEPTORS, HttpClientModule } from '@angular/common/http';
import { LoginComponent } from './login/login.component';
const appRoutes: Routes = [
{path: 'login', component: LoginComponent},
{path: 'notes', component: NoteListComponent, canActivate: [OktaAuthGuard]},
{path: 'notes/:id', component: NoteDetailComponent, canActivate: [OktaAuthGuard]},
{path: '', redirectTo: '/notes', pathMatch: 'full'}
];
@NgModule({
declarations: [
AppComponent,
NoteListComponent,
NoteDetailComponent,
LoginComponent
],
imports: [
BrowserModule,
HttpClientModule,
RouterModule.forRoot(appRoutes),
BrowserAnimationsModule,
MatToolbarModule,
MatListModule,
MatCardModule,
MatButtonModule,
MatIconModule,
MatInputModule,
FormsModule
],
providers: [NoteService, OktaAuthService, OktaAuthGuard, {
provide: HTTP_INTERCEPTORS,
useClass: OktaAuthInterceptor,
multi: true
}],
bootstrap: [AppComponent]
})
export class AppModule {
}