27 lines
709 B
TypeScript
27 lines
709 B
TypeScript
import {Component, inject, OnInit} from '@angular/core';
|
|
import {Router} from '@angular/router';
|
|
import {HeaderComponent} from '@header/header.component';
|
|
|
|
@Component({
|
|
selector: 'app-sent',
|
|
imports: [
|
|
HeaderComponent
|
|
],
|
|
templateUrl: './sent.component.html',
|
|
styleUrl: './sent.component.scss',
|
|
standalone: true
|
|
})
|
|
export class SentComponent implements OnInit {
|
|
protected message: string = "The form is completed and has been sent";
|
|
private router: Router = inject(Router)
|
|
|
|
ngOnInit() {
|
|
const navigation = this.router.getCurrentNavigation();
|
|
const state = navigation?.extras.state as { message: string };
|
|
|
|
if (state?.message) {
|
|
this.message = state.message;
|
|
}
|
|
}
|
|
}
|