flatiron/director — Issue #77: this when using a resource
Author: enix
Created: 2012-01-26 12:49:53+00:00
State: open

Hi,

I've got a question on how to handle **this** in the following (browser) scenario.

var MyApp = function(){
}

MyApp.prototype.start = function() {
console.log(**this**);
};

var app = new MyApplication();

routes = {
'/': 'start',
}

Router(routes).configure({resource:app}).init();

When I point my browser to "#/" start gets called, but the console.log(this) prints the a.Router object.

Is there a way to get **this**' set to the resource?

Thanks