forked from tomalaforge/angular-challenges
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhome.component.ts
More file actions
33 lines (30 loc) · 960 Bytes
/
home.component.ts
File metadata and controls
33 lines (30 loc) · 960 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import { Component } from '@angular/core';
import { MatNavList } from '@angular/material/list';
import { RouterLink } from '@angular/router';
import { NavButtonComponent } from './nav-button.component';
@Component({
imports: [NavButtonComponent, RouterLink, MatNavList, NavButtonComponent],
selector: 'app-home',
template: `
<div id="top" class="h-screen bg-gray-500">
<mat-nav-list>
<h2>Welcome to home page</h2>
<app-nav-button [routerLink]="['/foo']" class="fixed left-1/2 top-3">
Foo Page
</app-nav-button>
</mat-nav-list>
<div>
<app-nav-button [routerLink]="[]" fragment="bottom">
Scroll Bottom
</app-nav-button>
</div>
</div>
<div id="bottom" class="h-screen bg-blue-300">
I want to scroll each
<app-nav-button [routerLink]="[]" fragment="top">
Scroll Top
</app-nav-button>
</div>
`,
})
export class HomeComponent {}