V0.1j Routing + Navbar funktioniert. Zweiter Einkaufszettel angelegt
This commit is contained in:
@@ -1,3 +1,6 @@
|
||||
<app-header></app-header>
|
||||
<app-blog-create></app-blog-create>
|
||||
<body>
|
||||
<router-outlet></router-outlet>
|
||||
</body>
|
||||
<app-footer></app-footer>
|
||||
|
||||
|
||||
+11
-3
@@ -4,10 +4,14 @@ import { NgModule } from '@angular/core';
|
||||
|
||||
import { AppComponent } from './app.component';
|
||||
import {FormsModule, ReactiveFormsModule} from '@angular/forms';
|
||||
import { NavbarComponent } from './navbar/navbar.component';
|
||||
import { NavbarComponent } from './components/navbar/navbar.component';
|
||||
import { HeaderComponent } from './components/header/header.component';
|
||||
import { FooterComponent } from './components/footer/footer.component';
|
||||
import { BlogCreateComponent } from './components/blog-create/blog-create.component';
|
||||
import { AppRoutingModule } from './app-routing.module';
|
||||
import { Einkaufszettel1Component } from './components/einkaufszettel1/einkaufszettel1.component';
|
||||
import { HomeComponent } from './components/home/home.component';
|
||||
import { Einkaufszettel2Component } from './components/einkaufszettel2/einkaufszettel2.component';
|
||||
|
||||
@NgModule({
|
||||
declarations: [
|
||||
@@ -16,12 +20,16 @@ import { BlogCreateComponent } from './components/blog-create/blog-create.compon
|
||||
NavbarComponent,
|
||||
HeaderComponent,
|
||||
FooterComponent,
|
||||
BlogCreateComponent
|
||||
BlogCreateComponent,
|
||||
Einkaufszettel1Component,
|
||||
HomeComponent,
|
||||
Einkaufszettel2Component
|
||||
],
|
||||
imports: [
|
||||
BrowserModule,
|
||||
FormsModule,
|
||||
ReactiveFormsModule
|
||||
ReactiveFormsModule,
|
||||
AppRoutingModule,
|
||||
],
|
||||
providers: [],
|
||||
bootstrap: [AppComponent]
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
<h1>Einkaufszettel1</h1>
|
||||
<app-blog-entry *ngFor="let entry of entries" [entry]="entry"></app-blog-entry>
|
||||
<h2>Neuen Einkaufszettel Eintrag anlegen:</h2>
|
||||
<div>
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
<h1>Einkaufszettel2</h1>
|
||||
<app-blog-create><app-blog-entry></app-blog-entry></app-blog-create>
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { Einkaufszettel2Component } from './einkaufszettel2.component';
|
||||
|
||||
describe('Einkaufszettel2Component', () => {
|
||||
let component: Einkaufszettel2Component;
|
||||
let fixture: ComponentFixture<Einkaufszettel2Component>;
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ Einkaufszettel2Component ]
|
||||
})
|
||||
.compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(Einkaufszettel2Component);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,15 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
|
||||
@Component({
|
||||
selector: 'app-einkaufszettel2',
|
||||
templateUrl: './einkaufszettel2.component.html',
|
||||
styleUrls: ['./einkaufszettel2.component.css']
|
||||
})
|
||||
export class Einkaufszettel2Component implements OnInit {
|
||||
|
||||
constructor() { }
|
||||
|
||||
ngOnInit(): void {
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
<nav>
|
||||
<h1>Willkommen in der Einkaufszettel-App</h1>
|
||||
<div>
|
||||
<h3>Bitte wählen sie einen Einkaufszettel aus:</h3>
|
||||
<a routerLink="/einkaufszettel1" routerLinkActive="active">Einkaufszettel1</a>
|
||||
</div>
|
||||
<div>
|
||||
<a routerLink="/einkaufszettel2" routerLinkActive="active">Einkaufszettel2</a>
|
||||
</div>
|
||||
</nav>
|
||||
@@ -0,0 +1,25 @@
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { HomeComponent } from './home.component';
|
||||
|
||||
describe('HomeComponent', () => {
|
||||
let component: HomeComponent;
|
||||
let fixture: ComponentFixture<HomeComponent>;
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ HomeComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(HomeComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,15 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
|
||||
@Component({
|
||||
selector: 'app-home',
|
||||
templateUrl: './home.component.html',
|
||||
styleUrls: ['./home.component.css']
|
||||
})
|
||||
export class HomeComponent implements OnInit {
|
||||
|
||||
constructor() { }
|
||||
|
||||
ngOnInit(): void {
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
.nav-link {
|
||||
color: red
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
<nav class="navbar navbar-expand-lg navbar-dark bg-dark">
|
||||
|
||||
<div class="collapse navbar-collapse"
|
||||
[ngClass]="{ 'show': navbarOpen }">
|
||||
<ul class="navbar-nav mr-auto">
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="home">Startseite</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="einkaufszettel1">Einkaufszettel1</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="einkaufszettel2">Einkaufszettel2</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</nav>
|
||||
@@ -1,23 +0,0 @@
|
||||
<nav class="navbar navbar-expand-lg navbar-dark bg-dark">
|
||||
<a class="navbar-brand" href="#">
|
||||
Menü
|
||||
</a>
|
||||
|
||||
<button class="navbar-toggler" type="button"
|
||||
(click)="toggleNavbar()">
|
||||
<span class="navbar-toggler-icon"></span>
|
||||
</button>
|
||||
|
||||
<div class="collapse navbar-collapse"
|
||||
[ngClass]="{ 'show': navbarOpen }">
|
||||
<ul class="navbar-nav mr-auto">
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="#">Einkaufszettel 1</a>
|
||||
</li>
|
||||
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="#">Einkaufszettel 2</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</nav>
|
||||
+1
-1
@@ -8,6 +8,6 @@
|
||||
<link rel="icon" type="image/x-icon" href="favicon.ico">
|
||||
</head>
|
||||
<body>
|
||||
<app-root></app-root>
|
||||
<app-root></app-root>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user