funky-framadate-front/src/app/ui/navigation/navigation.component.ts

37 lines
867 B
TypeScript
Raw Normal View History

import {Component, Input, OnInit} from '@angular/core';
2019-08-10 17:41:01 +02:00
import {BaseComponent} from '../../pages/base-page/base.component';
2020-01-16 10:20:15 +01:00
import {Router} from '@angular/router';
2019-12-03 17:20:57 +01:00
import {ConfigService} from '../../services/config.service';
@Component({
2019-08-10 17:41:01 +02:00
selector: 'framadate-navigation',
templateUrl: './navigation.component.html',
styleUrls: ['./navigation.component.scss']
})
2019-08-10 17:41:01 +02:00
export class NavigationComponent extends BaseComponent implements OnInit {
@Input() public step = 'home';
constructor(public config: ConfigService,
public route: Router) {
2019-08-10 17:41:01 +02:00
super(config);
2019-08-10 17:41:01 +02:00
}
2019-08-10 17:41:01 +02:00
ngOnInit() {
2019-08-10 17:41:01 +02:00
}
2019-08-10 17:41:01 +02:00
nextPage() {
if (this.checkValidity()) {
if (this.config.step < this.config.stepMax) {
this.config.step++;
}
} else {
this.displayErrorMessage();
}
}
}