mimetype added. Thanks page added

This commit is contained in:
HuskyTeufel
2022-02-09 14:38:28 +01:00
parent 1e86549b69
commit eb563671f2
9 changed files with 67 additions and 17 deletions

View File

@@ -4,6 +4,7 @@ import { BesucherComponent } from './besucher/besucher.component';
import { ContactComponent } from './contact/contact.component';
import { HomeComponent } from './home/home.component';
import { LocationComponent } from './location/location.component';
import { ThanksComponent } from './thanks/thanks.component';
import { WegbeschreibungComponent } from './wegbeschreibung/wegbeschreibung.component';
const routes: Routes = [
@@ -11,8 +12,9 @@ const routes: Routes = [
{ path: 'home', component: HomeComponent},
{ path: 'client',component: BesucherComponent},
{ path: 'unserfest',component: LocationComponent},
{ path:'contact', component: ContactComponent},
{path:'wegbeschreibung', component: WegbeschreibungComponent}
{ path: 'contact', component: ContactComponent},
{ path: 'wegbeschreibung', component: WegbeschreibungComponent},
{ path: 'thanks', component: ThanksComponent}
];
@NgModule({

View File

@@ -18,6 +18,7 @@ import { LocationComponent } from './location/location.component';
import { ContactComponent } from './contact/contact.component';
import { DisclaimerComponent } from './disclaimer/disclaimer.component';
import { WegbeschreibungComponent } from './wegbeschreibung/wegbeschreibung.component';
import { ThanksComponent } from './thanks/thanks.component';
@NgModule({
declarations: [
@@ -29,7 +30,8 @@ import { WegbeschreibungComponent } from './wegbeschreibung/wegbeschreibung.comp
LocationComponent,
ContactComponent,
DisclaimerComponent,
WegbeschreibungComponent
WegbeschreibungComponent,
ThanksComponent
],
imports: [
BrowserModule,

View File

@@ -4,6 +4,7 @@ import { MatRadioModule } from '@angular/material/radio';
import { filter } from 'rxjs';
import { BesucherService } from '../besucher.service';
import { Besucher } from 'src/besucher';
import { Router, ActivatedRoute } from '@angular/router';
@@ -25,7 +26,7 @@ export class BesucherComponent implements OnInit {
BesucherKommtRadio: string = "";
kommt: string[] = ['Ja','Nein'];
constructor(private besucherService: BesucherService) {
constructor(private besucherService: BesucherService, private route: Router ) {
}
ngOnInit(): void {
@@ -36,19 +37,10 @@ export class BesucherComponent implements OnInit {
getAll() {
this.besucherService.getBesucherList().subscribe((data: Besucher[]) => {
this.activeBesuchers = data;
console.log(data);
//console.log(data);
});
}
/*getAll() {
this.besucherService.getBesucherList()
.pipe(
filter((data): data is Besucher[] => data instanceof Besucher))
.subscribe(data => {
this.activeBesuchers = data.filter((a) => !a.come);
this.kommendeBesuchers = data.filter((a) => a.come);
});
}*/
addBesucher() {
var newBesucher : Besucher = {
@@ -57,10 +49,12 @@ export class BesucherComponent implements OnInit {
id: '',
come : this.convertBesucherkommtStringToBoolean(this.BesucherKommtRadio)
};
console.log(newBesucher.come);
this.besucherService.addBesucher(newBesucher).subscribe(() => {
this.getAll();
this.BesucherMessage = '';
this.BesucherName = '';
this.route.navigate(['/thanks']);
})
}

View File

View File

@@ -0,0 +1,3 @@
<h1>Vielen Dank!</h1>
<h4>Ihre Nachricht wurde versendet!</h4>
<h5>Klicken Sie <a routerLink="/home">hier</a> um zur Startseite zu kommen</h5>

View File

@@ -0,0 +1,25 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { ThanksComponent } from './thanks.component';
describe('ThanksComponent', () => {
let component: ThanksComponent;
let fixture: ComponentFixture<ThanksComponent>;
beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [ ThanksComponent ]
})
.compileComponents();
});
beforeEach(() => {
fixture = TestBed.createComponent(ThanksComponent);
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-thanks',
templateUrl: './thanks.component.html',
styleUrls: ['./thanks.component.css']
})
export class ThanksComponent implements OnInit {
constructor() { }
ngOnInit(): void {
}
}

View File

@@ -4,7 +4,7 @@
export const environment = {
production: false,
gateway: '',
gateway: 'http://localhost:3001',
callback: 'http://localhost:4200/callback',
};