Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 70612

Get data from firebase with unique ID

$
0
0

@Haxeb wrote:

I can access data from firebase, but not in a good way.

service.js
service.getData = function(userid) {
var ref = new Firebase("https://urlhere" + "users/" );
return $firebaseObject(ref.child(userid));
}

userid is something like this, 700c122a-067d-4a02-baae-f5d12343242

My firebase structure looks like , http://i.imgur.com/AMdZLCt.png

controller.js
` .controller('ProfileCtrl', function($scope, $rootScope, Auth, $state, $stateParams, firebaseService) {

$scope.userid = $stateParams.userId;
$scope.details = firebaseService.getData($scope.userid);

})`

view
<p ng-repeat="item in details">
<span>{{item}} </span>
</p>
</ion-content>

The problem is, it displays all values of keys under Unique ID.
See my result. http://i.imgur.com/ZsB1bOY.png
I need to get name of user, when {{item.firstname}} in view.

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 70612

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>