Infiniti Scroll with firebase and Ionic

Asked

Viewed 56 times

0

Guys I’m here in a pinch, I’m using firebase v3.2.1 and I’m trying to implement an Infinity Scroll with Ionic, the point is that I don’t know how to do, I googled and found a firebaseUtils library but it’s not compatible with the new version of firebase. so I’d appreciate it if you’d help me out, because I’ve been trying to figure this out for three days. my service is like this.

angular.module('app').factory('artigoService', artigoService);
artigoService.$inject = ['$firebaseObject', '$firebaseArray'];

function artigoService($firebaseObject, $firebaseArray) {

    var rootrEF = firebase.database().ref().child('constituicao');
    var object = $firebaseObject(rootrEF);
    var array = $firebaseArray(rootrEF);

    return {
        getArray: getArray,
        getObject: getObject,
        getAll: getAll,
        getByArtigo: getByArtigo
    }


    function getArray() {

        return array.$loaded();
    }

    function getObject() {

        return object.$loaded();
    }

    function getAll() {
        return object;
    }

    function getByArtigo() {

        var query = rootrEF.orderByChild("artigo").limitToLast(2);
        return $firebaseArray(query);


    }


}

  • I don’t know exactly, but maybe you should try treating firebase as if it were some json, to apply the concept of ion-infinite-scroll - http://ionicframework.com/docs/api/directive/ionInfiniteScroll/

  • I tried to do it, but it doesn’t work. I could make an example just so I could get the idea

1 answer

-2

Ionic we can say that is the front of Cordova, if you go on the IONIC page will find your CSS’s use the will work! ;)

  • already solved, thanks guys.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.