UNPKG

ember-ghost

Version:

Fully-functional, SEO friendly static site implementation of a blog system built on Ember.

19 lines (17 loc) 439 B
import Route from '@ember/routing/route'; import { hash } from 'rsvp'; import { get } from '@ember/object'; export default Route.extend({ model(params) { return hash({ tag: params.id, posts: this.store.query('content', { path: 'content', }).then((posts) => posts.filter((post) => { if (get(post, 'tags')) { return get(post, 'tags').includes(params.id); } })) }) } });