Skip to content

Latest commit

 

History

History
32 lines (24 loc) · 1.15 KB

README.md

File metadata and controls

32 lines (24 loc) · 1.15 KB

ember-preferences

Steps

  1. Create preferences service that:
  • writes to local storage
  • reads from local storage
  • notifies when a preference changes
  1. Inject the service on all routes, controllers and components
  • create preferences mixin
  • create initializer and inject mixin to Route, Controller and Component
  1. Computed property
  • read from preferences
  • read default value
  • write to preferences
  • return value from set operation to update de cp
  1. Demo
  • add prop in the application controller and play with it

Exercises

  1. LocalStorage changed event
  2. Support more types of objects (with JSON.serialize/parse)
  3. Create get-preference helper