Assume we have an Article
model as follows:
export default DS.Model.extend({
author: DS.belongsTo('user'),
tagline: DS.attr('string'),
body: DS.attr('string'),
});
Assume also that we have a lot of pages, and on every single page we want a ticker that shows the taglines for brand new articles. Since it's on every page, we load all (new) articles at the application root level and have a component display them:
That way we can visit any nested page and see the taglines (without adding the component to every page).
The problem is, we do not want to see the ticker tagline for an article while it's being viewed, but the root-level taglines-ticker
has no knowledge of what child route is activated so we cannot simply filter by params.article_id
. Is there a clean way to pass that information up to the parent route?
Note: This is not a duplicate of how to determine active child route in Ember 2?, as it does not involve showing active links with
Aucun commentaire:
Enregistrer un commentaire