相关文章推荐
玩足球的莴苣  ·  gradle' plugin ...·  1 年前    · 
英俊的遥控器  ·  SpringBoot security ...·  1 年前    · 
Collectives™ on Stack Overflow

Find centralized, trusted content and collaborate around the technologies you use most.

Learn more about Collectives

Teams

Q&A for work

Connect and share knowledge within a single location that is structured and easy to search.

Learn more about Teams
require("amd-loader");
import someModule = require('../mymodule')
var someClass  = new someModule.MyNamespace.MyClass();

it becomes:

define(["require", "exports", '../mymodule'], function (require, exports, someModule) {
    require("amd-loader");
    var someClass = new someModule.MyNamespace.MyClass();

then it gives me define is not defined error

When I modify it as below, error goes away.

require("amd-loader");
define(["require", "exports", '../mymodule'], function (require, exports, someModule) {
    var someClass = new someModule.MyNamespace.MyClass();

Then I get Cannot read property 'MyClass' of undefined error

How can I get fix these error and get it work as expected as mentioned in that Q&A?

My environment is Visual Studio 2015 and I compile with AMD options as module system(obviously I tried each options). I am doing angular protractor e2e tests

@DavidSherret But it is talking about TypeScript HTML application and mine is protractor test project – asdf_enel_hak Sep 5, 2015 at 7:47

Thanks for contributing an answer to Stack Overflow!

  • Please be sure to answer the question. Provide details and share your research!

But avoid

  • Asking for help, clarification, or responding to other answers.
  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.