How to use ngx-scrolltop?
Back to Top button for your Angular projects. No jQuery dependency or anything. It’s supported in all Angular versions.
1. Here is the command you need to run to install the ngx-scrolltop module into your angular application:
npm i ngx-scrolltop
2. Here is the code you need to add to your app.module.ts file:
import { NgxScrollTopModule } from 'ngx-scrolltop'; @NgModule({ imports: [ NgxScrollTopModule ] })
3. Here is the code you need to add to your app.component.html file:
<ngx-scrolltop></ngx-scrolltop>
For more information: click here