I try to use namespaces on TS 1.6 with multiple files on the same NS.
---------------------------------------------------
app/core/config/core.config.ts
---------------------------------------------------
namespace app.core.config {
export class CoreConfig {
public appConfig : CoreConfigApp;
constructor() {
// Uncaught TypeError: config.CoreConfigApp is not a function
this.appConfig = new CoreConfigApp().getDevelopment();
}
}
}
---------------------------------------------------
app/core/config/core.config.app.ts
---------------------------------------------------
namespace app.core.config {
export class CoreConfigApp implements ICoreConfig {
public name : string;
public version : string;
constructor() {
this.name = 'super app';
this.version = '1.0.0-alpha';
}
getDevelopment() {
return this;
}
getProduction() {
return this;
}
}
}
---------------------------------------------------
app/core/config/core.config.interfaces.ts
---------------------------------------------------
namespace app.core.config {
export interface ICoreConfig {
getDevelopment() : any;
getProduction() : any;
}
}
The interface seams to be shared as expected. But the CoreConfigApp class throws a error in core.config.ts file.
tsconfig:
{
"compilerOptions": {
"module": "commonjs",
"sourceMap": true,
"target": "es5",
"experimentalDecorators": true
},
"exclude": [
"bower_components",
"node_modules"
]
}
What do I miss in the code, that my class is also accessable on other files in the same namespace? reference path definitions didn't help. thank you very much for hints!