Quantcast
Channel: JavaScriptMVC Forum
Viewing all articles
Browse latest Browse all 3491

Helper methods on route change

$
0
0
Hi
I have created a helper method in my can component that checks if a css class should be set or not
  1. if (can.route.current({ placeTypeGuid: options.context.guid })) {
  2.            return options.fn();
  3.                 } else {
  4.                     return options.inverse();
  5. }
  6. <div id="{{guid}}" class="panel-body {{#isCurrent}}active{{/isCurrent}}">
Works fine on first load and reload. But if i change the route with a click on the link it would be evaluated.
What is the best way to reevaluate this method. Or can i use the live binding?
thx
christoph

Viewing all articles
Browse latest Browse all 3491

Trending Articles