angular-lfmo

Simple models for localforage
1 person uses it
Author: 46198?v=3 aeby

angular-lfmo Build Status

Angular factory to define simple models for https://github.com/mozilla/localForage (Offline storage, improved.)


Features:

  • Manages your model entries using an index

  • Allows you to find your models using filter expressions

  • Bind one entry or a collection to your $scope

  • Lightweight (3kB) and depends on localForage only

Usage:

  • Download the project or install via bower bower install angular-lfmo or npm npm install angular-lfmo
  • Download localForage or install via bower bower install localforage or npm npm install localforage
  • Put angular-lfmo.js and localforage.js into your project
  • Add the module angular-lfmo to your application
  • Use the $lfmo factory

Visit this plunker for a complete example.

Factory Functions:

  • define(name): returns a model

Model Functions:

  • create(data): creates a new entry

  • get(id): retrieves an entry

  • update(id, data): updates an entry at given id

  • remove(id): removes an entry

  • findAll(filterExpression): finds all entries matching the given filter expression

  • bindAll($scope, scopeKey, filterExpression): lets you directly bind all entries matching the given filter expression to a $scope variable

  • bindOne($scope, scopeKey, id): lets you directly bind an entry to a $scope variable

comments powered by Disqus
This page was last updated about 2 years ago.