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 8869535
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T17:30:03+00:00 2026-06-14T17:30:03+00:00

I started to use Web Essentials and I see there’s an option Use the

  • 0

I started to use Web Essentials and I see there’s an option “Use the AMD module”. I am using typescript for an ASP MVC4 application. Can someone explain what the AMD module is all
about. Is this something that I should know about?

  • 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-14T17:30:05+00:00Added an answer on June 14, 2026 at 5:30 pm

    AMD is one way to format and load modular JavaScript. See here: http://addyosmani.com/writing-modular-js/ and especially here: http://requirejs.org/docs/whyamd.html

    To quote from that latter source:

    The AMD format comes from wanting a module format that was better than
    today’s “write a bunch of script tags with implicit dependencies that
    you have to manually order” and something that was easy to use
    directly in the browser.

    Essentially AMD allows you to load JavaScript modules on demand, and provides a format for encapsulating their content so the Global namespace isn’t polluted.

    In TypeScript, with the AMD compiler switch that you’ve discovered set to ‘on’, you export a module like this:

    export module pe.components {
        export class Component {  // 'export' makes this visible outside the module
    
        }
    
        class FriendComponent { // no 'export' so this is only visible inside the module.
    
        }
    }
    

    And in another file you import this module like this:

    import c = module('relative-path-to-file/pe.components');

    And then use it like this:

    var component:Component = new c.pe.components.Component(); // Works, because Component is exported

    … but not this:

    var friend:FriendComponent = new c.pe.components.FriendComponent(); // Shouldn’t work* because FriendComponent is not exported.

    (* there was a bug that made non-exported interfaces visible outside their declaring modules. I think this has been fixed in TS 0.8.1).

    As to the second part of your question – this is really too broad. If your architecture requires you to load new functionality (plug-ins or applets within a single page application, for example), then yes, AMD modules and a loading framework such as RequireJS may be the way to go. If, on the other hand, you know in advance all the functionality your users are going to require, you might be better off just minifying your scripts thoroughly and loading them in advance as a single file.

    I don’t think the fact that you are working with MVC is relevant here: the question is whether your client-side architecture warrants an asynchronous, modular approach.

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

Sidebar

Related Questions

I have started a new web application and have decided to use jquery as
I've started a C# web application project using subsonic 3.0.3 as my DAL and
I'm currently developing with Struts 1 a web application. I've recently started to use
I use this web.config : <traceAreas> <add provider=ASP verbosity=Verbose /> <add provider=ASPNET areas=Infrastructure,Module,Page,AppServices verbosity=Verbose
I've recently started a web application and decided to use url routing in it
I have a web application in Ruby on Rails. We use mongrel clusters started
I have started a new mvc project and clicked on project\properties\web - use local
I started to use ggplot in order to generate some graphs. I am using
I started working on a web application. This application needs lot of image handling.
Is it possible to use Web Api in an existing project of Asp.Net MVC

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.