Hello everybody,
I tried to use nipplejs libray in ionic 2 but without success.
I have added the library with npm like this:
npm install nipplejs --save
In my home.ts, i have added:
declare var nipplejs: any;
and in the constructor:
var radius = 100;
var sampleJoystick = { mode: 'dynamic', position: { left: '50%', top: '50%' }, size: radius*2, color: 'black' };
var joystick; var position; joystick = nipplejs.create(sampleJoystick);
but with ‘ionic serve’ i have this error :
ReferenceError: nipplejs is not defined
at new HomePage (http://localhost:8100/build/main.js:35447:20)
at _View_HomePage_Host0.createInternal (HomePage_Host.ngfactory.js:16:24)
When i add a library with “npm --save”, normally the ionic build add automaticaly the js to the app, no ?
Best regards