in App:
var bootstrap = new Bootstrap();
bootstrap.init( this, this.onBootstrapComplete );
in Bootstrap:
this.init = function( app, completeHandler ){
_app = app;
_completeHandler = completeHandler;
...
}
...
var _allReady = function(){
_completeHandler( _app );
}
back in App:
this.onBootstrapComplete = function( app )
{
app.something();
app.someValue = ...
}
I wanted to get this context inside onBootstrapComplete. It works but it doesn't look right :)
If let's say I wanted to call onBootstrapComplete directly from App, I would have to call it this.onBootstrapComplete( this ).
How can I do it so my onBootstrapComplete looks like this:
this.onBootstrapComplete = function()
{
this.something();
this.someValue = ...
}