Add routing
This commit is contained in:
parent
c1903c8f40
commit
dd2c299e35
4 changed files with 36 additions and 2 deletions
13
src/app/app-routing.module.spec.ts
Normal file
13
src/app/app-routing.module.spec.ts
Normal 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();
|
||||||
|
});
|
||||||
|
});
|
19
src/app/app-routing.module.ts
Normal file
19
src/app/app-routing.module.ts
Normal 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 { }
|
|
@ -1 +1 @@
|
||||||
<app-transactions></app-transactions>
|
<router-outlet></router-outlet>
|
||||||
|
|
|
@ -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]
|
||||||
|
|
Loading…
Reference in a new issue