MCPcopy Index your code
hub / github.com/NagRock/ngx-auto-scroll

github.com/NagRock/ngx-auto-scroll @1.1.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release 1.1.0 ↗ · + Follow
12 symbols 17 edges 3 files 0 documented · 0%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Angular 2+ auto scroll directive

Installation

npm install ngx-auto-scroll

Usage

In module:

import {NgxAutoScrollModule} from "ngx-auto-scroll";

@NgModule({
    ...
    imports: [ ..., NgxAutoScrollModule]
    ...
})

In template:






{{ message }}





Attributes:

Argument passed to lock-y-offset is bottom offset of scroll position in pixels after scroll container stops auto scroll. Default value is 10.

observe-attributes (optional, default - false) enable listening on attributes changes for example detect changes in font size.

Forcing scroll down

When your DOM element or its parent is hidden auto scroll won't work. There is no simple/pure way to scroll hidden element. The best way is to force scrolling down after the element is shown.

import {NgxAutoScroll} from "ngx-auto-scroll";

@Component({
   selector: 'sample',
})
export class SampleComponent {
    @ViewChild(NgxAutoScroll) ngxAutoScroll: NgxAutoScroll;

    public forceScrollDown(): void {
        this.ngxAutoScroll.forceScrollDown();
    }
}

Building

This component is built as an Angular 5 module using ng-packagr.

npm run ng-build

Publishing

To build and publish this component as an Angular 5 module use

npm run ng-publish

Core symbols most depended-on inside this repo

scrollDown
called by 2
src/ngx-auto-scroll.directive.ts
getObserveAttributes
called by 1
src/ngx-auto-scroll.directive.ts
constructor
called by 0
src/ngx-auto-scroll.directive.ts
ngAfterContentInit
called by 0
src/ngx-auto-scroll.directive.ts
ngOnDestroy
called by 0
src/ngx-auto-scroll.directive.ts
forceScrollDown
called by 0
src/ngx-auto-scroll.directive.ts
isLocked
called by 0
src/ngx-auto-scroll.directive.ts
scrollHandler
called by 0
src/ngx-auto-scroll.directive.ts

Shape

Method 8
Class 4

Languages

TypeScript100%

Modules by API surface

src/ngx-auto-scroll.directive.ts10 symbols
src/ngx-auto-scroll.module.ts2 symbols

For agents

$ claude mcp add ngx-auto-scroll \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact