Reputation: 599
Here is my scenario, simply put.
JS File 1 (Namespace.js):
/// <reference path="Namespace.more.js" />
var Namespace = {
property1 = 'something useful';
}
JS File 2 (Namespace.more.js):
Namespace.more = {
another = 'another useful thing';
}
This is much more complex in the actual implementation, but for my purpose it'll serve fine. I cannot get the intellisense to work correctly on the original file. It makes sense, it complains the the Namespace object does not exist (which it doesn't at the start of the file).
My question is, how would you properly organize these documents, and get the correct intellisense? Assuming there is much more than just the simple object described here.
I have many files which build on a single file that has the original namespace delcaration, each new object has its own file.
Upvotes: 1
Views: 558
Reputation: 888185
Your <reference>
is backwards.
You need to reference the original file (which creates the namespace) in .more
(which uses it).
Upvotes: 1