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

Re : Pretty urls

$
0
0
You have a couple of options here. Setting a hash url is basically the same as calling can.route.attr with removeOthers set to true. The destructive way of doing this would be to simply have hard links to the each option and call it a day. Otherwise, you can either setup a helper function or listen to the event and update can.route within you callback accordingly.

With the first option, something along the lines of:
  1. can.Mustache.registerHelper('url', function(field, data) {
  2.       return can.route.url({ field : data.attr(field) });
  3. });
  4. {{link 'foo' bar}}


Viewing all articles
Browse latest Browse all 3491

Trending Articles