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

  • SEARCH
  • Home
  • 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 9162661
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T14:15:49+00:00 2026-06-17T14:15:49+00:00

My bootstrapper.ts that gets run from the main.ts entry point looks like this (minus

  • 0

My bootstrapper.ts that gets run from the main.ts entry point looks like this (minus the references heading):

import Dialogs = App.Widgets.Dialogs;
declare var $ : JQueryStatic;


export class Bootstrapper { 
    static SiteLoad() { 
       var dialog = new Dialogs.LoginDialog();
       ...
    }
}

However, when main.ts attempts to load this file the first line immediately throws a reference error. That’s when I realized importing an internal module doesn’t add any dependencies to the define wrapper of the generated .js file.

So then how do I resolve internal modules at run-time? Is it the case that AMD is only compatible with external modules and I have to load internal ones along with external libraries in the entry point in main.ts?

I prefer the aliases syntax of internal modules over external ones. The code I have above looks much cleaner than when using external module syntax:

import Dialogs = module("Modules/App.Widgets.Dialogs");
declare var $ : JQueryStatic;


export class Bootstrapper { 
    static SiteLoad() { 
       var dialog = Dialogs.App.Widgets.Dialogs.LoginDialog(); //Seriously?
       ...
    }
}

That’s just ugly. What to do?

UPDATE:

Steve, the approach you suggest has a limitation. In my original approach using internal modules I can do the following:

import Dialogs = App.Widgets.Dialogs;

declare var $ : JQueryStatic;

export class Bootstrapper { 
    static SiteLoad() { 

        var loginDialog1 = new Dialogs.LoginDialog();  //Instantiation      -OK
        var loginDialog2: Dialogs.LoginDialog;         //Type-Declaration   -OK
    }
}

In the approach you suggest I lose the ability to use the alias for type declarations:

import DialogsModule =  module("Modules/App.Widgets.Dialogs");

var Dialogs : DialogsModule.App.Widgets.Dialogs;

declare var $ : JQueryStatic;

export class Bootstrapper { 
    static SiteLoad() { 

        var loginDialog1 = new Dialogs.LoginDialog();   //Instantiation  -OK        
        var loginDialog2: Dialogs.LoginDialog;  //Type-Declaration -ERROR: The name "Dialogs" does not exist in the current context  
        var loginDialog3: DialogsModule.App.Widgets.Dialogs.LoginDialog;  //Must use full name instead
    }
}
  • 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-17T14:15:51+00:00Added an answer on June 17, 2026 at 2:15 pm

    You can alias a long module path like this:

    import DialogModule = module("Modules/App.Widgets.Dialogs");
    var dialogs = DialogModule.App.Widgets.Dialogs;
    declare var $ : JQueryStatic;
    
    export class Bootstrapper { 
        static SiteLoad() { 
           var dialog = dialogs.LoginDialog();
           ...
        }
    }
    

    You can mix AMD with plain JavaScript by including the appropriate files yourself – but I recommend picking one pattern to use in your program to make things simpler to understand.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Trying to solve this problem . I would like to learn how the bootstrapper
I use the burn tool from WiX v3.6.1601.0 to create a bootstrapper that will
I have a Bootstrapper that looks through all Assemblies in an ASP.NET MVC application
I'm using Wix 3.6 and I would like to implement a bootstrapper for my
We recently added a feature to our software that requires .NET 2.0 SP2. This
I am using the basic Unity MVC Nuget Bootstrapper. I would like to Inject
I have a wix bootstrapper that is checking if .net framework 4.0 is installed
I have a JavaScript bootstrapper module that I'm trying to keep very clean and
I have an ASP.NET MVC app which has a bootstrapper class that configures log4net
I have an app that I'm upgrading from some beta bits - and my

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.