Sunday 15 January 2012

javascript - Canjs: trigger a route event for the current page -


I have one. Control which looks like this:

  can.Control ({"route": function () {...}, "a.test click": function () {can.route. Attr ({Page: "home", type: "test"});}}); Type "home" in the current page {page: "test"} If "routing" callback is not being called.  

How can I trigger the pathway regardless of the page?

My thoughts ...
I can call this.route () directly, but then the URL I have to handle is changing, which is not a good solution makes.

  "{can.route} change": work (eve, atri, how, newwell , Old Naval) {If (== 'Your page') {// Your change}}   

In canges about routes here: < / Html>

No comments:

Post a Comment