Search code examples
meteoriron-router

What could cause a layoutTemplate's helpers to be rerun?


I'm navigating between two routes that have the same layoutTemplate. By default, the layout helpers are not rerun:

http://meteorpad.com/pad/TP6QoWiryAde6du6u/Copy%20of%20IR

However, in my app, they are – even a one-line helper that just calls console.log. Note that:

  • the layout's onRendered is not called again.
  • it only happens going from and to a single route, but not the others

What are the reasons why this could happen?


Solution

  • Taking this out of that single route fixed it!

    data: ->
      code: @params.code
    

    Replaced with Router.current().data()?.code in helpers & onRendered.