DoneJS StealJS jQuery++ FuncUnit DocumentJS
6.6.1
5.33.3 4.3.0 3.14.1 2.3.35
  • Bitovi
    • Bitovi.com
    • Blog
    • Design
    • Development
    • Training
    • Open Source
    • About
    • Contact Us
  • GitHub
  • Twitter
  • Chat
  • Forum
  • News
Bitovi

import

  • Edit on GitHub

importModule(moduleName, parentName)

var importModule = require("can-util/js/import/import");

importModule("foo.stache").then(function(){
  // module was imported
});

Parameters

  1. moduleName {String}:

    The module to be imported.

  2. parentName {String}:

    A parent module that will be used as a reference for resolving relative module imports.

Returns

{Promise}:

A Promise that will resolve when the module has been imported.

CanJS is part of DoneJS. Created and maintained by the core DoneJS team and Bitovi. Currently 6.6.1.

On this page

Get help

  • Chat with us
  • File an issue
  • Ask questions
  • Read latest news