In my applicaiton, in the stache templates I’ve been using routeUrl to change the application page. This works fine. I’ve got some D3js diagrams and clicking on stuff is supposed to change the page. However due to a bug I raised in can-route-pushstate
I cannot use routeUrl. Therefore, I capture the click event and then try to change the page from within the viewmodel like this.
Now, this works, but it generates a warning.
“appViewModel” is being called as a function. This will not happen automatically in an upcoming release. You should call it explicitly using “appViewModel()”.
I’m not sure if it cleans up the route nicely (as does routeUrl).
So my question. Is there a better way to change the route from the viewmodel (that would avoid this warning) and clean up the route like routeUrl.
I really like the warnings that are generated in canjs 3. They really help to avoid errors. The only problem is that sometimes it is difficult to work out what is actually causing the warning.