mirror of
https://github.com/Mueller-Patrick/Betterzon.git
synced 2025-04-18 14:59:19 +00:00
33 lines
828 B
TypeScript
33 lines
828 B
TypeScript
import {Component, OnInit} from '@angular/core';
|
|
import {Router} from '@angular/router';
|
|
import {ApiService} from "../../services/api.service";
|
|
|
|
@Component({
|
|
selector: 'app-landingpage',
|
|
templateUrl: './landingpage.component.html',
|
|
styleUrls: ['./landingpage.component.css']
|
|
})
|
|
export class LandingpageComponent implements OnInit {
|
|
searchInput: string;
|
|
isLoggedIn = false;
|
|
|
|
constructor(
|
|
private router: Router,
|
|
private api: ApiService
|
|
) {
|
|
}
|
|
|
|
ngOnInit(): void {
|
|
|
|
}
|
|
|
|
startedSearch(): void {
|
|
this.redirectTo('/search', {queryParams: {q: this.searchInput}});
|
|
}
|
|
|
|
redirectTo(uri: string, queryParams: object): void {
|
|
this.router.navigateByUrl('/', {skipLocationChange: true}).then(() =>
|
|
this.router.navigate([uri], queryParams));
|
|
}
|
|
}
|