mirror of
https://github.com/Raghu-Ch/angular-challenges.git
synced 2026-02-13 14:23:02 -05:00
feat(anchorScrolling): create challenge
This commit is contained in:
20
apps/anchor-scrolling/src/app/home.component.ts
Normal file
20
apps/anchor-scrolling/src/app/home.component.ts
Normal file
@@ -0,0 +1,20 @@
|
||||
import { Component } from '@angular/core';
|
||||
import { NavButtonComponent } from './nav-button.component';
|
||||
|
||||
@Component({
|
||||
standalone: true,
|
||||
imports: [NavButtonComponent],
|
||||
selector: 'app-home',
|
||||
template: `
|
||||
<nav-button href="/foo" class="fixed top-3 left-1/2">Foo Page</nav-button>
|
||||
<div id="top" class="h-screen bg-gray-500">
|
||||
Empty
|
||||
<nav-button href="#bottom">Scroll Bottom</nav-button>
|
||||
</div>
|
||||
<div id="bottom" class="h-screen bg-blue-300">
|
||||
I want to scroll each
|
||||
<nav-button href="#top">Scroll Top</nav-button>
|
||||
</div>
|
||||
`,
|
||||
})
|
||||
export class HomeComponent {}
|
||||
Reference in New Issue
Block a user