Add routing

This commit is contained in:
William Brawner 2018-08-27 21:54:21 -05:00
parent c1903c8f40
commit dd2c299e35
4 changed files with 36 additions and 2 deletions

View file

@ -0,0 +1,13 @@
import { AppRoutingModule } from './app-routing.module';
describe('AppRoutingModule', () => {
let appRoutingModule: AppRoutingModule;
beforeEach(() => {
appRoutingModule = new AppRoutingModule();
});
it('should create an instance', () => {
expect(appRoutingModule).toBeTruthy();
});
});

View file

@ -0,0 +1,19 @@
import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { TransactionsComponent } from './transactions/transactions.component';
const routes: Routes = [
{ path: '', redirectTo: '/transactions', pathMatch: 'full' },
{ path: 'transactions', component: TransactionsComponent },
]
@NgModule({
imports: [
RouterModule.forRoot(routes)
],
exports: [
RouterModule
],
declarations: []
})
export class AppRoutingModule { }

View file

@ -1 +1 @@
<app-transactions></app-transactions> <router-outlet></router-outlet>

View file

@ -5,6 +5,7 @@ import {MatButtonModule, MatIconModule, MatListModule, MatToolbarModule} from '@
import { AppComponent } from './app.component'; import { AppComponent } from './app.component';
import { TransactionsComponent } from './transactions/transactions.component'; import { TransactionsComponent } from './transactions/transactions.component';
import { AppRoutingModule } from './app-routing.module';
@NgModule({ @NgModule({
declarations: [ declarations: [
@ -17,7 +18,8 @@ import { TransactionsComponent } from './transactions/transactions.component';
MatButtonModule, MatButtonModule,
MatIconModule, MatIconModule,
MatListModule, MatListModule,
MatToolbarModule MatToolbarModule,
AppRoutingModule
], ],
providers: [], providers: [],
bootstrap: [AppComponent] bootstrap: [AppComponent]