Reputation: 63599
When using a pathFor
template helper, how can we pass Router.current().params._id
into it?
The following code
<a href="{{ pathFor 'myPage' _id=Router.current().params._id }}">
gives an error
Expected space ...e' _id=Router.current().params._id }}" cl...
^`
Upvotes: 1
Views: 242
Reputation: 8345
Use Router.current.params._id
instead of Router.current().params._id
. Meteor will dynamically check the property values, and if it comes across a function, it will call it.
Upvotes: 1