Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to add os-scroll extension in Angular #4

Open
swagata1603 opened this issue Nov 26, 2020 · 0 comments
Open

How to add os-scroll extension in Angular #4

swagata1603 opened this issue Nov 26, 2020 · 0 comments

Comments

@swagata1603
Copy link

I have tried to add this extension in my angular app. But getting this error - index.js:1 Uncaught ReferenceError: OverlayScrollbars is not defined

I have added the cdn in my index.html -
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/os-scroll-chain@1/dist/os-scroll-chain.min.js"></script>

I have added these two in my main ts file

import * as scrollChain from 'os-scroll-chain';
OverlayScrollbars.extension("scrollChain", scrollChain );

Then in my custom overlay scrollbar component I have used this -

OverlayScrollbars(
  this.osTarget(),
  this._options || {},
  { scrollChain: {vertical: false, horizontal: false} }
); 
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant