Say I want to have one class per .ts file. I have two .ts files, that look like so:
export module MyClasses { export class A {} }
and
Unfortunately there does not seem to be a perfect solution but this is how I solved it for now:
File 'Controllers/MainController.ts':
class MainController {
...
}
export = MainController;
File 'Controllers/SecondController.ts':
class SecondController {
...
}
export = SecondController;
File 'Controllers/Namespace.ts':
import MainController = require('./MainController');
import SecondController = require('./SecondController');
export = { MainController, SecondController }
File 'App.ts' (where the 'namespace' is used)
import Controllers = require('Controllers/Namespace');
angular.module('app', [])
.controller('MainController', Controllers.MainController)
.controller('SecondController', Controllers.SecondController)
This gives you nice intellisense, hides the 400 import statements away and keeps the code where the namespace is actually used pretty clean...