Problems with typescript
Closed this issue · 2 comments
Hansel03 commented
I think the float-labels.js is great
I downloaded the project with npm install float-labels.js and then I loaded
the dist / float-labels.css and dist / float-labels.min.js with the web package, but for some reason you do not see the styles.
Additionally I also load the script.js file in my webpack and still it still does not work.
I understand that the project is done in javascript, but is there any way to use it in typescript with webpack?
This is the configuration file that I am loading
"node_modules/float-labels.js/demo/script.js",
/** global: FloatLabels */
var floatlabels;
var toggleBtn = document.querySelector('.fl-toggle');
var styles = document.getElementsByName('style');
var getStyle = function () {
for (var i = 0; i < styles.length; ++i) {
if (styles[i].checked) {
return styles[i].value;
}
}
return 0;
};
floatlabels = new FloatLabels('.form-1', {
style: getStyle(),
});
"node_modules/float-labels.js/dist/float-labels.css"
"node_modules/float-labels.js/dist/float-labels.min.js"
thank you very much
pryley commented
Why are you using the javascript from the demo? Just call it like this:
var floatlabels = new FloatLabels( '.form-1' );