angular - Property 'sumo' does not exist on type 'HTMLElement' for SumoSelect JQuery -
i trying implement "clear" or "reset" functionality sumoselect dropdown have implemented. using angular 4. code call when want clear dropdown:
var num = $('option').length; for(var i=0; i<num; i++){ $('#state')[0].sumo.unselectitem(i); }
i installed sumoselect in node_modules putting in typings.d.ts:
interface jquery { sumoselect(any):void; }
in .angular-cli.json included appropriate js , css files. sumoselect dropdown works fine can't figure out how application recognize sumo on third line of first code segment. have tried other interfaces jquery , htmlelement , no luck.
try importing sumo in component.
import * sumo 'sumoselect';
and import * $ 'jquery';
or
`declare var $ : ;` //in component
Comments
Post a Comment