I try to read some data from firebase, but my logic doesn’t work..
the problem seems to occur when I create a database ref.
my lib version:
AngularJS v1.6.5
AngularFire v2.3.0
Firebase v4.3.1
My firebase db:
{
"post" : [ null, {
"message" : "hi",
"name" : "Mario Rossi"
}, {
"message" : "hi",
"name" : "Alessia Gallina"
}, {
"message" : "hi",
"name" : "Stefano Macchi"
}, {
"message" : "hi",
"name" : "Roberto Singapore"
}, {
"message" : "hi",
"name" : "Elena Soghi"
}, {
"message" : "hi",
"name" : "Bet Bet"
} ]
}
my controller:
(function () {
'use strict';
angular.module( 'messenger' )
.controller('fireGetPost', [ 'FIREBASE','$scope','$firebaseArray', function(FIREBASE, $scope, $firebaseArray) {
var vm = this;
vm.data = [];
// Init firebase ap
firebase.initializeApp(
FIREBASE.config()
);
var ref = firebase.database().ref();
var posts = ref.child("post");
$scope.posts = new $firebaseArray(posts);
}]);
})();
my html:
<md-content ng-controller="fireGetPost as controller" layout="column" class="showcase">
<md-virtual-repeat-container id="vertical-container" flex>
<div ng-repeat="data in controller.posts">
<md-content class="md-padding" layout-xs="column" layout="row">
<div flex-xs flex-gt-xs="50" layout="column">
<md-card class="card" md-theme="" md-theme-watch>
<md-card-content>
<p></p>
</md-card-content>
</md-card>
</div>
</md-content>
</div>
</md-virtual-repeat-container>
and the output console is:
Error: Firebase Database (4.3.1) INTERNAL ASSERT FAILED: Missing index implementation for isEmpty
at o (libs.min.js:773)
at i (libs.min.js:773)
at libs.min.js:773
at h (libs.min.js:773)
at t.addToIndexes (libs.min.js:773)
at t.updateImmediateChild (libs.min.js:773)
at t.updateChild (libs.min.js:773)
at t.updateChild (libs.min.js:773)
at t.updateSnapshot (libs.min.js:773)
at t.Ri (libs.min.js:773) "<main data-ng-view="" class="ng-scope" data-ng-animate="1">"
Thanks in advance!!
ps. naturally, my bundle includes:
[ ‘ngRoute’, ‘ngMaterial’, ‘ngCookies’, ‘firebase’ ]
Source: AngularJS
from Angular Questions https://angularquestions.com/2017/09/30/angularjs-error-firebase-database-4-3-1-internal-assert-failed-missing-index-implementation-for-isempty/
via @lzomedia #developer #freelance #web #lzomedia.com
No comments:
Post a Comment