Having two different namespaces can be tricky.
namespace1:
file1.ts
///<reference path="./file2" />
import * as NameSpace2 from './file2';
export namespace namespace1 {
export class Class1 {
constructor(){}
public sayHello(){
console.log("Hello");
}
}
}
file2.ts
namespace 2:
export namespace namespace2 {
export class Class2 {
constructor(){}
public sayHi(){
console.log("Hi");
}
}
}
I really want to use the things in namespace 2 within namespace 1.
But unfortunately, when I tried that, an error occurred:
The import declarations in a namespace cannot refer to a module.