None
None

Reputation: 9247

How to access to data in object?

When i console.log(this.user) i get this:

Object
isLoggedIn
:
true
user
:
Object
created_at
:
"2017-03-14 09:04:42"
email
:
"[email protected]"
id
:
4
name
:
"user"
updated_at
:
"2017-03-14 09:04:42"

But when i now to try to access this.data.email i get undefined. Any suggestion how can i get email from this object?

Because in my template i want do something like this:

  <div class="panel-body">
         You are logged in! <span>{{ user.email }} </span>

   </div>

Upvotes: 0

Views: 44

Answers (1)

Kavoos
Kavoos

Reputation: 417

I'm not sure if it's gonna work for you, but try this in your html:

<div class="panel-body">
    You are logged in! <span>{{ user.user.email }} </span>
</div>

Upvotes: 1

Related Questions