ifvisible.js icon indicating copy to clipboard operation
ifvisible.js copied to clipboard

Docs about how to use ifvisible.js on Angular 2 app?

Open theunreal opened this issue 9 years ago • 3 comments

Anyone? Tried to stackoverflow too, but no solution found

http://stackoverflow.com/questions/38030846/using-javascript-library-in-angular-2/38032553?noredirect=1#comment63523559_38032553

theunreal avatar Jun 27 '16 16:06 theunreal

@theunreal Did you figure this out?

muhammaddadu avatar Sep 20 '16 10:09 muhammaddadu

I know it's late but I'm working on the V2. which is written in TypeScript. You'll be able to use it by simply importing the library now.

You can help me testing by trying out

npm install ifvisible.js@next

in javascript/webpack it should work with

import { ifvisible } from "ifvisible.js"
// or
const ifvisible = require("ifvisible.js").ifvisible;

in typescript it should work with

import { IfVisible } from "ifvisible.js/src/ifvisible";
const ifvisible = new IfVisible(window, document);

It's still in beta, so it still might change but all help is appreciated.

serkanyersen avatar Nov 10 '16 06:11 serkanyersen

You need to use ifvisible.js@next, the v1 didn't have any exports in it it would just register the lib on the window

Tofandel avatar Jul 06 '21 08:07 Tofandel