Book Image

Ionic Cookbook

By : Hoc Phan
Book Image

Ionic Cookbook

By: Hoc Phan

Overview of this book

Table of Contents (18 chapters)
Ionic Cookbook
Credits
Foreword
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Rendering a large Firebase data set using collection-repeat


When your app grows, the size of the database also grows. Typically, there are many ways to handle large datasets such as paging, caching, and filtering. However, there is a very useful feature in Ionic that allows you to repeat through a large list of items without sacrificing performance. Ionic's collection-repeat is similar to AngularJs' ng-repeat. The main difference is its rendering mechanism. Most of the time, the app does not need to render thousands of items at once. So, collection-repeat accesses only a subset of the data and binds it to the current page, where it is visible to the user.

Getting ready

You will continue to work on the previous app. There are some modifications in index.html and app.js.

How to do it...

Here is how you can retrieve data and add, edit, and delete items:

  1. Open index.html to edit it.

  2. Insert the following code within <body>:

    <ion-pane ng-controller="ItemCtrl">
      <ion-header-bar class="bar...