I'm trying to write some TypeScript application and came up to conclusion that i don't like <reference path />
statement. 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 tryed: 'ViewModels/ApplicationViewModel', 'ApplicationVM' asl. I even combined it with <reference path />
but it didn't help as well.