1

In my code I have something like

this.users = firebase.database.list("/users");

which I can access in the HTML Code like:

<tbody *ngFor="let user of users | async" >
      <tr >
        <td>
          {{user._name}}
        </td>
      </tr>

which works great. But how I can I access this the _name variable for example in the native JS code? I would always get errors that the variable does not exist.

1
  • post your code here for which you get error. Commented Sep 27, 2016 at 7:20

1 Answer 1

1

Instead of doing this

this.users = firebase.database.list("/users");

you can do this:

firebase.database.list("/users").subscribe(users => this.users = users);

Now you have access to the users array in your controller.

In your template you should also remove the async pipe.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.