I need some help related with Typescript and how to use external modules in Internal Modules.
I want to store all my ViewModel code logic in the ViewModels internal module.
** HomePageViewModel.ts **
module ViewModels {
export class HomePageViewModel {
constructor() {
console.log('Creating HomePageViewModel');
}
public SayHello(): void {
console.log('Hello from HomePageViewModel');
}
}
}
** ViewModelFactories **
public static CreateHomePageViewModel(): ViewModels.HomePageViewModel {
return new ViewModels.HomePageViewModel();
}
This is working correctly and I can compile and everything works fine at execution time.
Now if I add an import in HomePageViewModel (knockout for example)
import ko = require('knockout');
Typescript no longer compiles. The ViewModelFactories code is underline under Views and inform me that it 'Could Not Find symbol Views'.
How can I access the knockout module from within the ViewModel module?