ember-data-slug
Slug support for store.findRecord
.
If your API supports to reference a model via slug additionally to the id, then
this addon allows you to use findRecord
with both the slug or id:
let findViaSlug = store.findRecord("video", "best-dance-ever");
let findViaId = store.findRecord("video", "1");
This addon ensures that the same records are referenced within Ember Data:
Ember.RSVP.all([ findViaSlug, findViaId ]).then(function([ foundViaSlug, foundViaId ]) {
foundViaSlug === foundViaId;
});
Install via:
ember install ember-data-slug
Development
Installation
git clone
this repositorynpm install
bower install
Running
Running Tests
npm test
(Runs ember try:testall
to test your addon against multiple Ember versions)ember test
ember test --server
Building
For more information on using ember-cli, visit http://ember-cli.com/.