I tried to import fuse.js in a angular2 app, but I get an exception (Fuse is not defined). I also check definitions file (index.d.ts) in the package.
my class in typescript is :
import 'fuse.js';
export class Myclass{
/**some code*/
public mySearchFunction(text, list, Opts){
let fuseSearch = new Fuse(list, Opts);
let fuseResults: any[] = fuseSearch.search(text);
return fuseResults
}
}
I tried also with
import * as Fuse from 'fuse.js';
What is the right way to use this library?