Docs about how to use ifvisible.js on Angular 2 app?
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 Did you figure this out?
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.
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