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

Problem with can.route, requirejs and attributes.

$
0
0
Hi,
can.route.ready is called already when can is loaded, I'm using the AMD version 1.1.7:
  1. define([ 'can'] , function(can) {
  2.                 // here can.route already started.
  3. });
Now I got problems when I whant to work with defined routes and other attributes like:
  1. #!main/sub&type=video&foo=bar
When I reload the page, the hash will destroyed to, and the route doesn't work.
  1. #!&main%2Fsub=&type=video&foo=bar
The problem is, that can.route.ready is called when can is required, because of can.route line 516:
  1. if( (document.readyState === 'complete' || document.readyState === "interactive") && onready) {
The "onready" variable cannot change, so I don't have a possibility to really start the routing manually.

Why the routing always has to start automatically always on document ready?

For me all works fine, when I change route.js line 60 from
  1. onready = !0,
to
  1. onready = !1,
Maybe someone can give me a better solution?

Best wishes

Viewing all articles
Browse latest Browse all 3491

Trending Articles