I'm having some issues with getting a namespace across files to resolve and compile properly. According to documentation and this SO answer, the following should produce no issue:
App.Core.ts
namespace App.Core {
export function createElem(tagName: string): JQuery {
return $(document.createElement(tagName));
}
}
App.Core.SubModule.ts
/// <reference path="App.Core.ts" />
namespace App.Core.SubModule {
export function Test(): JQuery {
return App.Core.createElem("div");
}
However, Visual Studio is giving me an error on the function call in App.Core.SubModule.Test stating Property 'createElem' does not exist on type 'typeof Core' My understanding is that if a namespace is across multiple files TS compiler will automatically resolve those namespaces. It looks like the corresponding JavaScript is coming out correct however the lack of intellisense (and the red squiggle error line) is exceptionally frustrating and making me second guess what I'm writing.
Is this an issue with my file setup, with TS compiler, or with Visual Studio 2015's apparently broken TypeScript intellisense functionalities right now?
require.js. Definitely had a hard time deciphering and finding that on the TS documentation. But thank you for the help! Finally can get moving on the next part of my project! - willwolfram18