meteor-pages
meteor-pages copied to clipboard
Better Iron-Router Route Names
Hi,
Take a look at my example Gist: https://gist.github.com/pcorey/8736bc682c19cefb17fc
In this example, there are two routes associated with Items: mypages_page and mypages_home0
Ideally, I'd like to be able to specify my own route name so I can do something like {{pathFor 'items'}} instead of linking directly to the /items URL or digging through the meteor-pages internals to find out the route naming convention.
+1!!
My use case is taking advantage of Router.go in Template.events and being able to use the params and query options instead of manually serializing the url (gross)
Router.go('foo.index', {}, { query: myQueryObject }
vs
Router.go('/foo?' + $.param(myQueryObject)
I too had to dig into the source code to find a name like:
Router.go('foo_home0', {}, {query: myQueryObject}
which is not readable at all. would love the ability to specify the route name as part of the initialization options.
+1 :+1:
+1, I think it much better to use with pathFor if you can specify iron-route names