I tried importing the library directly
import * as hash from '../../../../node_modules/hashids';
and tried this code
let id = hash.encode(this.studentDocument.student_id_number); console.log(id);
But it throws this error, sad.
_node_modules_hashids__WEBPACK_IMPORTED_MODULE_2__.encode is not a function
I even tried this
declare var hash:any;
But it throws this error
hash is not defined
Any tip would be greatly appreciated! (a cont. of this post)
You need to create a new instance of the hashids object.