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

canjs routes and delegate, listen when property has a particular value?

$
0
0
I use canJs with plugin can.Map.delegate and i would like this, but it doesn't work, "ok" is not displaying in console.

Could you help me ?

    $(function() {

      var Routing = can.Control({
        '{can.route} id=3': function(data) {
          console.log("ok");
         }
      });

      var routeDelegate = can.route(":id");
      can.route.ready();
      routeDelegate.delegate("id", "set");

      new Routing(document);

      can.route.attr("id", 3);

    });
Thank you


Viewing all articles
Browse latest Browse all 3491

Trending Articles