ember.js - EmberJS: The right way to use a page multiple times -
i've got product index page need use multiple times:
# products product-index -> product # categorized products category -> subcategory -> product-index -> product # persons products profile -> product-index -> product
as can see product-index
, product
routes nested in multiple situations. in cases each view fullscreen page , pages user can navigate until root page.
my idea configure router this:
// router.js this.resource( "products", function() { this.route( "product", { path: "/:product_id" } ); } ); this.resource( "categories", function() { this.route( "category", { path: "/:category_id" }, function(){ this.resource( "products", function() { this.route( "product", { path: "/:product_id" } ); } ); } ); } ); this.route( "profile", function() { this.resource( "products", function() { this.route( "product", { path: "/:product_id" } ); } ); } );
but i'm wondering if above right way this, or maybe should link same product-index page , filter products. (eg products?cat=bags
or products?user=12
)
also, when i'm going use first solution need able re-use products controller
, i'm not sure how yet.
for i'd know right thing do, ember-wise, , why?
Comments
Post a Comment