@Injectable()
export class Utente {
nome: string;
descrizione: string;
constructor(
public storage: Storage
) { }
}
I’d like to create new Utente without specify storage, how can I do it (without removing storage)?
Now I can’t do something like this because the constructor requires storage:
let user = new Utente();
user.nome = "prova1";
user.descrizione = "prova2";
Lol, very good point. Yes, with a general class my solution is what you want, but once you add the @Injectable() on there, the assumption is this would be a singleton, so you’d never new it up anyway.