V0.1j Routing + Navbar funktioniert. Zweiter Einkaufszettel angelegt

This commit is contained in:
Christian Greif 2020-06-13 12:59:47 +02:00
parent 71a495e9b4
commit bddfef8d37
5 changed files with 61 additions and 0 deletions

View File

@ -0,0 +1,19 @@
import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import {Einkaufszettel1Component} from "./components/einkaufszettel1/einkaufszettel1.component";
import {HomeComponent} from "./components/home/home.component";
import {Einkaufszettel2Component} from "./components/einkaufszettel2/einkaufszettel2.component";
const routes: Routes = [
{ path: '', redirectTo: 'home', pathMatch: 'full'},
{ path: 'home', component: HomeComponent},
{ path: 'einkaufszettel1', component: Einkaufszettel1Component},
{ path: 'einkaufszettel2', component: Einkaufszettel2Component},
{ path: '**', redirectTo: 'home'}
];
@NgModule({
imports: [RouterModule.forRoot(routes)],
exports: [RouterModule]
})
export class AppRoutingModule { }

View File

@ -0,0 +1,2 @@
<h1>Einkaufszettel1</h1>
<app-blog-create><app-blog-entry></app-blog-entry></app-blog-create>

View File

@ -0,0 +1,25 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { Einkaufszettel1Component } from './einkaufszettel1.component';
describe('Einkaufszettel1Component', () => {
let component: Einkaufszettel1Component;
let fixture: ComponentFixture<Einkaufszettel1Component>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ Einkaufszettel1Component ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(Einkaufszettel1Component);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

View File

@ -0,0 +1,15 @@
import { Component, OnInit } from '@angular/core';
@Component({
selector: 'app-einkaufszettel1',
templateUrl: './einkaufszettel1.component.html',
styleUrls: ['./einkaufszettel1.component.css']
})
export class Einkaufszettel1Component implements OnInit {
constructor() { }
ngOnInit(): void {
}
}