Closed dewolft closed 5 years ago
il package non espone un oggetto.
prova a cambiare
import { CodiceFiscale } from 'codice-fiscale-js';
con:
import CodiceFiscale from 'codice-fiscale-js';
next setup works for me:
import:
import { compute } from 'codice-fiscale-js'
usage:
const cf = compute({ name: "Enzo", surname: "Righi", gender: "M", day: 24, month: 7, year: 1957, birthplace: "Francia", birthplaceProvincia: "EE" });
sorry @lucavandro , i have the same problem
using
import CodiceFiscale from 'codice-fiscale-js';
const cf = new CodiceFiscale({
name: "Enzo",
surname: "Righi",
gender: "M",
day: 24,
month: 7,
year: 1957,
birthplace: "Napoli"
});
console.log(cf);
returned
TypeError: codice_fiscale_js_1.default is not a constructor
at Object.
Ciao,
ho provato ad installare il modulo con NPM
npm i codice-fiscale-js --save
ho importato la libreria come indicato :
import { CodiceFiscale } from 'codice-fiscale-js';
ho chiamato la funzione come segue :
ritorna questo errore :
RROR TypeError: codice_fiscale_js_1.CodiceFiscale is not a constructor at GestioneEventoComponent.CalcolaCodiceFiscale (gestione.component.ts:275) at Object.eval [as handleEvent] (GestioneEventoComponent.html:256) at handleEvent (core.js:13589) at callWithDebugContext (core.js:15098) at Object.debugHandleEvent [as handleEvent] (core.js:14685) at dispatchEvent (core.js:10004) at eval (core.js:10629) at HTMLButtonElement.eval (platform-browser.js:2628) at ZoneDelegate.invokeTask (zone.js:421) at Object.onInvokeTask (core.js:4751)
Cosa sto sbagliando?