I have some object in my Component:
this.user = Authentication.user;
Which works just fine - it copies the reference, and if Authentication.user changes, this.user in my Component changes as well.
However, I am wondering, if it is possible to do the following:
this.user = Authentication.getUser()
where Authentication.getUser :
getUser(){
return this.user;
}
However, this does not seem to copy reference to user from Authentication.
Am I doing something wrong here, or it not possible?
UPDATE
Actually, it works pretty nice:
Authentication.useris, and where it comes from. " if Authentication.user changes, this.user in my Component changes as well." probably means when a property ofAuthentication.userchanges, otherwise this would not be the case. Please try to create a Plunker that demonstrates what you try to accomplish.