I want to use floatThead in my Angular2 app. I have install jquery as a global library.
In angular-cli.json
"scripts": ["../node_modules/jquery/dist/jquery.min.js",
"../node_modules/bootstrap/dist/js/bootstrap.min.js",
"../node_modules/ngx-rating/ngx-rating.pure.amd.js",
"../node_modules/bootstrap-select/dist/js/bootstrap-select.min.js",
"../node_modules/floatthead/dist/jquery.floatThead.min.js"
],
In the component I have imported both jquery and floatThead as follows
import * as $ from 'jquery';
import * as floatThead from 'floatThead';
...
$('card-list-table').floatThead({top:110,
responsiveContainer: function($table){
return $table.closest(".table-responsive");
}
});
There is no complitaion issue but I am getting this runtime error and plugin doesn't work
ERROR TypeError: __WEBPACK_IMPORTED_MODULE_5_jquery__(...).floatThead is not a function
at CustomerListComponent.webpackJsonp.../../../../../src/app/
It looks even I have imported jquery globally it has an issue jquery plugins getting loaded.
Can someone please suggest whats wrong in this scenario.