Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9224191
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T04:15:25+00:00 2026-06-18T04:15:25+00:00

in App: var bootstrap = new Bootstrap(); bootstrap.init( this, this.onBootstrapComplete ); in Bootstrap: this.init

  • 0

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 = ...
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T04:15:26+00:00Added an answer on June 18, 2026 at 4:15 am

    I would recommend using underscore.js. See http://underscorejs.org/#bind for further information.

    this.onBootstrapComplete = _.bind( function() {
       ...
       this.someFunction(); // this context is available now
       ... 
    }, this );
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Currently I have this code var App = Ember.Application.create(); App.user = Ember.Object.create({ people: customers
I'm using the javascript module pattern, and have this so far: var APP; if(APP
If I do (for example) for (int i=0;i<22;i++) { var app = new Excel.Application();
object ReassignTest extends App { class X(var i : Int) def x = new
Here is my attempt: function makeAllTextBlack() { var document = app.activeDocument, textFrames = document.textFrames,
I have such code in my app: var t = new Thread(new ThreadStart(new Action(SomeClass.SomeMethod)));
Here is my app: var express = require('express'), app = express.createServer(), RedisStore = require('connect-redis')(express);
So I have an object of ArrayProxy kind var App = Ember.Application.create(); App.car =
I've created a backbone view A and B : var App = { run:
I have the following node.js server-side code: var app = require('http').createServer(handler) , io =

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.