"integrity": "sha512-DyUDGxp4kF4majcm9COVzu/9wzmgnfj+d6GUEjYkbqSH9QP05LonJ6wHMNxNMN6qMfawdCxDe0TnNDRPmHUj9w==" | "integrity": "sha512-DyUDGxp4kF4majcm9COVzu/9wzmgnfj+d6GUEjYkbqSH9QP05LonJ6wHMNxNMN6qMfawdCxDe0TnNDRPmHUj9w==" | ||||
}, | }, | ||||
"@angular/router": { | "@angular/router": { | ||||
"version": "9.1.7", | |||||
"resolved": "https://registry.npmjs.org/@angular/router/-/router-9.1.7.tgz", | |||||
"integrity": "sha512-ycrkhkCbfOMCe9PngFjnyk8nH5jt0Kyb2NPtjmaGOtSCuZBZ0kOU0rQGmQnj3d2PiT0Yir59S8eEAf3Fh0iDuw==" | |||||
"version": "9.1.11", | |||||
"resolved": "https://registry.npmjs.org/@angular/router/-/router-9.1.11.tgz", | |||||
"integrity": "sha512-D6CCDeSK/F6dWSB/a1g/zB072xG5LadLSV8afQ57oX1KHePx21LcoRG4tUtFMMHh/jZXRc9pMQIR1/9FrrXF3Q==" | |||||
}, | }, | ||||
"@babel/code-frame": { | "@babel/code-frame": { | ||||
"version": "7.8.3", | "version": "7.8.3", |
"@angular/forms": "~9.1.7", | "@angular/forms": "~9.1.7", | ||||
"@angular/platform-browser": "~9.1.7", | "@angular/platform-browser": "~9.1.7", | ||||
"@angular/platform-browser-dynamic": "~9.1.7", | "@angular/platform-browser-dynamic": "~9.1.7", | ||||
"@angular/router": "~9.1.7", | |||||
"@angular/router": "^9.1.11", | |||||
"bootstrap": "^4.5.0", | "bootstrap": "^4.5.0", | ||||
"rxjs": "~6.5.4", | "rxjs": "~6.5.4", | ||||
"tslib": "^1.10.0", | "tslib": "^1.10.0", |
<app-header></app-header> | <app-header></app-header> | ||||
<app-blog-create></app-blog-create> | |||||
<body> | |||||
<router-outlet></router-outlet> | |||||
</body> | |||||
<app-footer></app-footer> | <app-footer></app-footer> | ||||
import { AppComponent } from './app.component'; | import { AppComponent } from './app.component'; | ||||
import {FormsModule, ReactiveFormsModule} from '@angular/forms'; | 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 { HeaderComponent } from './components/header/header.component'; | ||||
import { FooterComponent } from './components/footer/footer.component'; | import { FooterComponent } from './components/footer/footer.component'; | ||||
import { BlogCreateComponent } from './components/blog-create/blog-create.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({ | @NgModule({ | ||||
declarations: [ | declarations: [ | ||||
NavbarComponent, | NavbarComponent, | ||||
HeaderComponent, | HeaderComponent, | ||||
FooterComponent, | FooterComponent, | ||||
BlogCreateComponent | |||||
BlogCreateComponent, | |||||
Einkaufszettel1Component, | |||||
HomeComponent, | |||||
Einkaufszettel2Component | |||||
], | ], | ||||
imports: [ | imports: [ | ||||
BrowserModule, | BrowserModule, | ||||
FormsModule, | FormsModule, | ||||
ReactiveFormsModule | |||||
ReactiveFormsModule, | |||||
AppRoutingModule, | |||||
], | ], | ||||
providers: [], | providers: [], | ||||
bootstrap: [AppComponent] | bootstrap: [AppComponent] |
<h1>Einkaufszettel1</h1> | |||||
<app-blog-entry *ngFor="let entry of entries" [entry]="entry"></app-blog-entry> | <app-blog-entry *ngFor="let entry of entries" [entry]="entry"></app-blog-entry> | ||||
<h2>Neuen Einkaufszettel Eintrag anlegen:</h2> | <h2>Neuen Einkaufszettel Eintrag anlegen:</h2> | ||||
<div> | <div> |
<h1>Einkaufszettel2</h1> | |||||
<app-blog-create><app-blog-entry></app-blog-entry></app-blog-create> | |||||
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(); | |||||
}); | |||||
}); |
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 { | |||||
} | |||||
} |
<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> |
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(); | |||||
}); | |||||
}); |
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 { | |||||
} | |||||
} |
.nav-link { | |||||
color: red | |||||
} |
<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> |
<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> |
<link rel="icon" type="image/x-icon" href="favicon.ico"> | <link rel="icon" type="image/x-icon" href="favicon.ico"> | ||||
</head> | </head> | ||||
<body> | <body> | ||||
<app-root></app-root> | |||||
<app-root></app-root> | |||||
</body> | </body> | ||||
</html> | </html> |