-
Notifications
You must be signed in to change notification settings - Fork 0
Can't Find Classes in Another File but Under the same Namespace
Manabu Tokunaga edited this page Mar 16, 2017
·
2 revisions
You have split your sources into more than one files under the same namespace and the first file does not pick up the class or value defined in another file under the same namespace.
You should export any symbols that you need to share with other files. This is counter-intuitive because in C# or JavaScript package they will share anything under the same named space. See export class usage in File 2.
namespace TheSpace {
class myStuff {
name = "my stuff";
static print() {
let t = new TheirSpace();
let h = herName;
console.log(`Found ${t.name} in theirspace and ${h} in her space`);
}
}
myStuff.print();
}
namespace TheSpace {
export class TheirSpace {
name = "their stuff";
}
}
This open source product is provided under the terms of the MIT License.