Skip to content

How to add os-scroll extension in Angular #4

@swagata1603

Description

@swagata1603

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} }
); 

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions