6

I have an app.js file which has dojo amd pattern code as follows:

require(["dojo/dom", ..], function(dom){
  dom.byId('someId').innerHTML = "test";
});

And using tsd, I have installed dojo.d.ts

And also created jsconfig.json file:

{
  "compilerOptions": {
  "target": "ES6",
    "module": "commonjs"
  }
}

But the intellisense is not working. Am I doing anything wrong?

1 Answers1

0

Am I doing anything wrong

Yes. require(["dojo/dom", ..], function(dom){ the variable dom will have an inferred type of any.

Fix

Use import/require and compile with --module amd : http://basarat.gitbooks.io/typescript/content/docs/project/modules.html

basarat
  • 261,912
  • 58
  • 460
  • 511