I've made a really simple class,
user.class.js
'use strict';
class User {
constructor(id) {
this.id = id;
}
getUserId() {
return this.id;
}
}
and in my main controller, when someone logs in, I want to create a new instance of that class like this
const user = new User(2);
but how can I access this user from another controller?
Thank you