Reputation: 852
how to access items in firebase using angularjs I got how many rows in firebase but not the values
my code
<ul class="next-days" >
<li ng-repeat="item in val">
{item.name}
<a href="#43">
<p class="next-days-date"><span class="day">{item.text}</span> <span class="scnd-font-color">{item.price}</span></p>
<p class="next-days-temperature">{item.quan}</p>
</a>
</li>
</ul>
and my app.js
var ref = new Firebase("https://qwertyuiop.firebaseio.com/values");
$scope.val = $firebaseArray(ref);
Upvotes: 0
Views: 137
Reputation: 7688
Angular needs double curly brackets to render value in view. You used only one curly bracket.
For ex.
Instead of {item.name}
you need {{item.name}}
Here is plnkr.
Here is code
<ul class="next-days" >
<li ng-repeat="item in val">
{{item.name}}
<a href="#43">
<p class="next-days-date"><span class="day">{{item.text}}</span> <span class="scnd-font-color">{{item.price}}</span></p>
<p class="next-days-temperature">{{item.quan}}</p>
</a>
</li>
</ul>
Upvotes: 1
Reputation: 4406
You are just missing a second {
and }
, so this works:
<ul class="next-days" >
<li ng-repeat="item in val">
{{item.name}}
<a href="#43">
<p class="next-days-date"><span class="day">{{item.text}</span> <span class="scnd-font-color">{{item.price}}</span></p>
<p class="next-days-temperature">{{item.quan}}</p>
</a>
</li>
</ul>
Upvotes: 1