How to check for Route through route name in template with Meteor and Iron Router

前端 未结 4 678
你的背包
你的背包 2020-12-14 08:14

What can I use in a template to figure out the route name that is associated with the route that I am currently on?

For example if I configured a route

4条回答
  •  悲哀的现实
    2020-12-14 08:22

    You can define any options you want in your route config :

    Router.route('/', {
        name : 'home',
        template : 'home',
        title: 'Home'
    });
    

    and then access to title with this :

    Router.current().route.options.title
    

    This will output "Home"

提交回复
热议问题