GartorwareCorp / firebase-util

An experimental toolset for Firebase
http://firebase.github.io/firebase-util
MIT License
8 stars 9 forks source link

TypeError: Cannot read property 'Scroll' of undefined #15

Open mikeruto opened 7 years ago

mikeruto commented 7 years ago

Hello I have an error with the scroll: TypeError: Cannot read property 'Scroll' of undefined. I have this firebase structure:

firebasetabla3

my controller: app.factory('tablas3', function ($firebaseArray) { var tablas3 = firebase.database().ref().child("tabla3"); var tabla3Partido = new firebase.util.Scroll(tablas3, 'description'); return $firebaseArray(tabla3Partido); });

my app.js: angular.module('crud', ['ionic', 'angularMoment', 'ngCordova', 'ngCordovaOauth', 'firebase','firebase.utils'])

my index.html:

    <script src="lib/firebase-util/dist/firebase-util.min.js" type="text/javascript"></script>
    <script src="lib/firebase-util/dist/firebase-util-paginate.min.js" type="text/javascript"></script>
    <script src="lib/angularfire/dist/angularfire.min.js" type="text/javascript"></script>
    <script src="js/app.js"></script>

I followed this example: https://jsfiddle.net/katowulf/a67hfo6j/
My error is in my controller in this line: var tabla3Partido = new firebase.util.Scroll(tablas3, 'description'); My firebase version is: Firebase v3.7.0

cygvslince commented 5 years ago

Hi, same problem here, did you find a fix? thanks in advance,

mikeruto commented 5 years ago

response_container_BBPPID{font-family: initial; font-size:initial; color: initial;} Hi, its been 2 years by now , right now im using ionic 4 with angularfirebase 2 ... I think my problem was in this line:  firebase.database().ref().child("tabla3") i need to puth the push id in here, something like this :firebase.database().ref().child("tabla3/$pushId/")     you need to put exactly like this $pushId Enviado desde mi BlackBerry, el dispositivo móvil más seguro De: notifications@github.comEnviados: 23 de diciembre de 2018 16:09Para: firebase-util@noreply.github.comResponder a: reply@reply.github.comCC: miguelmike.mike@gmail.com; author@noreply.github.comAsunto: Re: [GartorwareCorp/firebase-util] TypeError: Cannot read property 'Scroll' of undefined (#15) Hi,

same problem here, did you find a fix? thanks in advance,

—You are receiving this because you authored the thread.Reply to this email directly, view it on GitHub, or mute the thread.

cygvslince commented 5 years ago

Hi thank you for your answer,

I know it is old, but I have to get an old app back on track and I am stuck. It seems, my problem is different : it is "firebase.util" which is undefined in my code.

Here is my code :

        var rootRef = firebase.database().ref();
        var authUsersRef = rootRef.child("authUsers");

        authUsersRef.once('value', function(data){
            console.log(data.val());
            // => returns the object properly
        });
        var scrollRef = new firebase.util.Scroll(rootRef, 'lastOnline');

I have tried, multiple things, but I don't find the right way to include "firebase-util" :

When I call it in app.js angular.module('starter', [ 'ionic', 'ionic.rating', 'tabSlideBox', 'firebase', 'firebase-util', ... with in my index.html : <script src="https://cdn.firebase.com/libs/firebase-util/0.2.5/firebase-util.min.js"></script> => Failed to instantiate module firebase-util due to: [$injector:nomod] Module 'firebase-util' is not available!

When I don't: angular.module('starter', [ 'ionic', 'ionic.rating', 'tabSlideBox', 'firebase', ... => firebase.util is undefined

I see that you wrote : 'firebase.utils' in your angular.module => is there anything I am missing ?

Sorry I am not an expert,

Thank you in advance,

David

gartorware commented 5 years ago

Mmm, this is a pretty old library which is not being developed anymore but it seems a problem with the library setup. See #3 and #4.