I'm trying to write a TypeScript application and came to a conclusion that I don't like the <reference path />
triple-slash directive. I find it more suitable to use import 'something'
instead.
But when I try to replace my reference paths I keep getting an error that module is unknown.
Here's my folder structure:
/app
/ViewModels
ApplicationViewModel.ts
app.ts
ApplicationViewModel.ts
module ApplicationVM {
export class ApplicationViewModel {
constructor(public test:string) {
}
}
}
app.ts
/// <reference path="ViewModels/ApplicationViewModel.ts" />
var a = new ApplicationVM.ApplicationViewModel('test');
this one works just fine. How do I get following code to work as well?
import * as App from 'noidea';
var a = new App.ApplicationViewModel('test');
For 'noidea' I tried: ViewModels/ApplicationViewModel
, ApplicationVM
asl. I even combined it with <reference path />
but it didn't help as well.