0

How can I add PerfectScrollbarComponent (ngx-perfect-scrollbar) selector is 'perfect-scrollbar' component dynamically to Angular 5 component?

Thank you in advance.

L. Kvri
  • 1,456
  • 4
  • 23
  • 41

1 Answers1

-1

In your template.html

<perfect-scrollbar #perfectscroll>...</perfect-scrollbar>

In your component.ts

import { PerfectScrollbarComponent } from 'ngx-perfect-scrollbar';
...
@ViewChild('perfectscroll') ps: PerfectScrollbarComponent;
...
this.ps.directiveRef.scrollToBottom();
user2132866
  • 111
  • 2
  • 6
  • Ok, but how can we do that, if we have a 3th. party component for example PrimeNG DataTable? https://github.com/primefaces/primeng/blob/master/src/app/components/datatable/datatable.ts – L. Kvri Oct 16 '18 at 11:20