krillebimbim krillebimbim - 4 years ago 71
HTTP Question

How do I retrieve the object details in angular?

I have tried to search for a solution to my problem but it seems my code should work. I have retrieved data from firebase and want to display it in my view.
The data object is shown in the developer console as being there when I am in the view in question.

My view:

<ion-view cache-view="false" ng-controller="PostCtrl">
<ion-nav-title>{{ viewname }}</ion-nav-title>
<ion-content class="has-header contentpane">

<div class="titlepane">
<h4 class="posttitle">
<p class="categorytitle">


The controller:

firebaseApp.controller('PostCtrl', function ($scope, firebaseApi, $stateParams) {
'use strict';

// Create a name for the view to show as the title
$scope.viewname = 'Svampe';

// The stateParams is defined in the Services.js and defined in the scope here.
$ = $;

// API call to the firebase for a specific post
firebaseApi.getSingle($ (succ) {
$scope.item = succ;
console.log("Items", $scope.item);
}, function(err) {
console.log('Error: ', err);


Do you have any idea why the data is not showing in the view? I can see the object is retrieved successfully but it's not showing.

Answer Source

Try this




Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download