Firebase-uti How to import an .js file

http://firebase.github.io/firebase-util/#/toolbox/Paginate/example/ionic

I wanted to use this solution.
But I do not know how to import the javascript file into the ionic project.
Which pasture should I add?
Can I use npm install to install?
Is it possible to transform this controller.js to control ts?

Thank you all

Import it in your index.html

But why do you don’t use angularfire2?

Thank you LoLStats for your attention.
I need to make a list that loads images on demand using infinite scroll.
I searched the internet is the only way I found was using this .js file.
As I’m very new to Ionic technology I’m kind of lost on how to make this example work.

Ps. Sorry for the english by google.

Do you use iOnic v1 or newer? Because the example you link to is for iOnic v1 and Angular 1

Ionic 2 version 3.01. This example does not work with Ionic 2? Can you help me in any way to accomplish this?

Yes, Ionic use Angular 4 (they call it now just Ionic since the 3.0 release).

So you should use angularfire2: https://github.com/angular/angularfire2
It is really easy to implement in Ionic.

So you can receive your data as a list like in the readme examples.
Then you can use Ionic’s Infinite Scroll API: https://ionicframework.com/docs/api/components/infinite-scroll/InfiniteScroll/

Okay. With angularfire I can return paged data?

Do you want to use the firebase DB or the firebase storage? Maybe i misunderstand your firebase usage.

I’m wearing both. In firebase storage is the image. In the database I have a node with several information is one of them and the path of the image.
I’m loading this into an ion-card list. I am worried that there will be several publications and be slow. That’s why I wanted to charge on demand. In fact this screen will have a functionality similar to facebook.

Okay good.
So you can use angularfire2 for firebase DB. You can create queries to receive the first 10 items for example and then lazy load the next 10 with Ionics InfiniteScroll API.

If you want to receive the images, you have to do something like this with angularfire2: http://www.muhammetbakan.com/angular2-ionic2-how-to-upload-and-get-image-from-firebase-storage/

I only work with the firebase DB so I hope that I can help you with this :slight_smile:

And one question, do you upload base64 images? If not this will be a good way to increase the performance.

First thank you very much for your attention. I am not working with base64 images. I’m going to study here to switch to that format.

Once again, I’m sorry for English.