mardi 25 avril 2017

Using autoNumeric 4.x with Emberjs

I am currently using autoNumeric 1.9.46 in one of my ember projects. I installed it as a bower dependency; since it is a jQuery plugin and added

app.import(`bower_components/autoNumeric/autoNumeric.js`);

to ember-cli-build.js file and it is all good. I can use it as described in documentation as $(selector).autoNumeric().

Now I decided to use autoNumeric v4.0.0-beta.14; but it seems to be ES6 module now. I tried to install it through npm install autonumeric and import it via import AutoNumeric from "AutoNumeric" but I got "Could not find module AutoNumeric imported from ..." error. I tried to install it through ember-browserify as described in here and import it as import AutoNumeric from 'npm:AutoNumeric' and still the same error. Can somebody help me in using autoNumeric v4.0.0-beta.14, which is now an ES6 module? I am open to any help in directing using custom ES6 modules with Emberjs as well. Thanks.




Aucun commentaire:

Enregistrer un commentaire