Fireplace is an Ember.js addon for Firebase.
Install as an Ember CLI addon:
npm install --save-dev fireplace
Then run the generator to install dependencies (Firebase from Bower):
ember generate fireplace
// 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.
git clone
this repositorynpm install
bower install
ember server
- Visit your app at http://localhost:4200.
ember test
ember test --server
ember build
For more information on using ember-cli, visit http://www.ember-cli.com/.