@abcum/ember-storagedeprecated

A utility for working with localStorage in an Ember.js app.

Usage no npm install needed!

<script type="module">
  import abcumEmberStorage from 'https://cdn.skypack.dev/@abcum/ember-storage';
</script>

README

ember-storage

A utility for working with localStorage in an Ember.js app.

Usage

Installation

ember install @abcum/ember-storage

Introduction

The ember-storage addon adds functionality for retrieving and manipulating localStorage key-value items from routes, controllers, templates, and components, enabling bound values and computed properties, whilst persisting data across page reloads.

Examples

Get the value for the localStorage['email'] key.

{{storage.email}}

Binding an input value directly to the localStorage['email'] key.

{{input type="text" value=storage.email}}

Using the storage service to get localStorage['email'] inside an Ember controller.

export default Ember.Controller.extend({
    actions: {
        login: function() {
            facebook.login( this.get('storage.email') );
        }
    }
})

Development

  • make install (install bower and ember-cli dependencies)
  • make upgrade (upgrade ember-cli to the specified version)
  • make tests (run all tests defined in the package)