angular ui
This commit is contained in:
0
src/app/components/menu/menu.component.css
Normal file
0
src/app/components/menu/menu.component.css
Normal file
4
src/app/components/menu/menu.component.html
Normal file
4
src/app/components/menu/menu.component.html
Normal file
@@ -0,0 +1,4 @@
|
||||
<h1>Menu Page</h1>
|
||||
<p>Select an option:</p>
|
||||
<button (click)="navigateToGame()">Play Game</button>
|
||||
<button (click)="navigateToOptions()">Options</button>
|
||||
19
src/app/components/menu/menu.component.ts
Normal file
19
src/app/components/menu/menu.component.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
import { Component } from '@angular/core';
|
||||
import { Router } from '@angular/router';
|
||||
|
||||
@Component({
|
||||
selector: 'app-menu',
|
||||
templateUrl: './menu.component.html',
|
||||
styleUrls: ['./menu.component.css'],
|
||||
})
|
||||
export class MenuComponent {
|
||||
constructor(private router: Router) {}
|
||||
|
||||
navigateToGame(): void {
|
||||
this.router.navigate(['/game']);
|
||||
}
|
||||
|
||||
navigateToOptions(): void {
|
||||
this.router.navigate(['/options'], { state: { mode: 'full' } });
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user