1.0.1 • Published 3 years ago

@releasium/ngx-simple-scroll v1.0.1

Weekly downloads
32
License
-
Repository
github
Last release
3 years ago

ngx-simple-scroll

Angular library that make ability scroll to particular element using service or directive.

Example of using NgxSimpleScrollService

    const scrollToServiceConfig = {
      targetSelector: `#targetId`,
      async: true,
    };

    this.ngxNgxSimpleScrollService.scrollTo(scrollToServiceConfig);

Example of extending NgxSimpleScrollDirective

@Directive({
	selector: '[scrollToError]'
})

export class ScrollToErrorDirective extends NgxSimpleScrollDirective {
	@Input() targetSelector = 'form-msg:not(:empty)';
	@Input() async = true;
	@Input() scrollToFocus = true;
	@Input() scrollToParent = true;
	@Input() parentSelector = '.form-group';
	@Input() scrollToAnimatedObject = false;
}