Daniel Gray
Daniel Gray

Reputation: 1792

Object in console shows getter with a value but in the code it returns undefined

The output in the console of the following code:

  console.log(userValues);

is:

Getter called from console

However, when I call it from the code (inside the ngOnInit(), I'm using Angular 6):

  console.log(userValues.USER_AUTH_MODE);

And this prints undefined.

Is there some other special way to call the getter that will return the object correctly?

Upvotes: 0

Views: 54

Answers (1)

HelloWorld
HelloWorld

Reputation: 2330

You circled "USER_AUTH_METHOD" property but are attempting to log "USER_AUTH_MODE" property which apparently does not exist

Upvotes: 1

Related Questions