I'm seeing some odd behavior in my JSMVC
3.2.2 application. I have a page controller where in one of my functions, I declare a new observable object, and it seems that when this is declared, the route is triggered again (and thus loading the page controller again). So basically, having an observable is causing the page to be loaded twice. This is according to my console statements and firebug.
When I remove the observable from my function, the page is only loaded once. Has anyone else seen this behavior at all? Or might have any idea as to why this is happening? Any help is appreciated.
- var myObservable = new $.Observable({});
- myObservable.bind('change', this.proxy('someFunction')); //this change event is only changing the display, not the route!
My Route handler looks like this, and I am seeing the console statement show up twice if the observable exists in the code.
- "myroute/:id route": function (routeData) {
- console.log("ROUTE: myroute/:id..");
- this.loadPage(App.TheController, {id: routeData.id});
- },