fireplace
v0.4.0
Published
A Firebase model library for Ember.js
Downloads
47
Readme
Fireplace
Fireplace is an Ember.js addon for Firebase.
Installation
Install as an Ember CLI addon:
npm install --save-dev fireplace
Then run the generator to install dependencies (Firebase from Bower):
ember generate fireplace
Quick Example
// app/models/person.js
import {Model, attr, hasOne, hasMany} from 'fireplace';
export default Model.extend({
firstName: attr(),
lastName: attr(),
age: attr("number"),
avatar: hasOne()
});
// app/routes/people.js
import Ember from 'ember';
export default Ember.Route.extend({
model() {
// list all people
return this.store.fetch("person");
}
});
// app/routes/person.js
import Ember from 'ember';
export default Ember.Route.extend({
model(params) {
return this.store.fetch("person", params.person_id);
}
});
See the documentation for more details.
Development
Installation
git clone
this repositorynpm install
bower install
Running
ember server
- Visit your app at http://localhost:4200.
Running Tests
ember test
ember test --server
Building
ember build
For more information on using ember-cli, visit http://www.ember-cli.com/.