Why do i get 3 elements back?

I trying to display data from Firebase in my Ionic app.

This is my code:

.controller('CatsCtrl', function($scope, $state, $http) {       firebase.database().ref("Home").on('value', function(snapshot) {         $scope.content = snapshot.val()         console.log($scope.content);     });    }) .controller('SubCatCtrl', function($scope, $http, $stateParams, $state) {    var catId = $stateParams.id;    console.log(catId);    firebase.database().ref("Subcategory/" + catId).on('value', function(snapshot) {     $scope.content = snapshot.val();     console.log($scope.content);   });   }) 

HTML CatsCtrl

<div ng-repeat="cat in content" class="animated lightSpeedIn">       <a ui-sref="subcat({id:cat.title})" nav-transition="none"><div ng-style="{'background': 'url(' + cat.bgurl + ')','background-repeat': 'no-repeat','background-size': 'cover','display': 'block','width': '100%','height': '25vh' }" class="bgcat center">         <div class="inner">           <h1 class="title_data">{{cat.titleview}}</h1>           <h4>{{cat.subtitle}}</h4>         </div>       </div></a>     </div> 

HTML SubcatsCtrl

<div ng-repeat="cat in content" class="animated lightSpeedIn">       <a ui-sref="subcat({id:cat.title})" nav-transition="none"><div ng-style="{'background': 'url(' + cat.subcatbgurl + ')','background-repeat': 'no-repeat','background-size': 'cover','display': 'block','width': '100%','height': '25vh' }" class="bgcat center">         <div class="inner">           <h1 class="title_data">{{cat.subcattitleview}}</h1>           <h4>{{cat.subcatsubtitle}}</h4>         </div>       </div></a>     </div> 

This is my data structure in Firbase:

Why do i get 3 elements back?
Why do i get 3 elements back? see here:

Why do i get 3 elements back?

The result of this is a huge gap in the App:

Why do i get 3 elements back?

How can I prevent this?

Any help much appreciated!

Replay

Category: html Time: 2016-07-31 Views: 2

Related post

iOS development

Android development

Python development

JAVA development

Development language

PHP development

Ruby development

search

Front-end development

Database

development tools

Open Platform

Javascript development

.NET development

cloud computing

server

Copyright (C) avrocks.com, All Rights Reserved.

processed in 0.127 (s). 12 q(s)