sticksy icon indicating copy to clipboard operation
sticksy copied to clipboard

How can I import sticksy lib in Angular aplication

Open cichy380 opened this issue 4 years ago • 1 comments

Hi,

sticksy lib in not exported as ES6 module, so how can I use it in eg. Angular app? For example

import Sticksy from 'sticksy';

in component ts file does not work (sticksy is not ES6 module)

cichy380 avatar Nov 02 '21 13:11 cichy380

As we can see in source code, you have to use window.Sticksy.

So you can do

import 'sticksy';

// then...
new window.Sticksy('.js-element');

monkeymonk avatar Nov 29 '21 17:11 monkeymonk