I am very new to TypeScript and I've run into a problem that I can't quite figure out...
I am using a library called TypeLite that will take my C# POCO's and convert them into TypeScript classes.
It is a T4 template that generates a file called TypeLite.Net4.d.ts, which as I understand, .d files are definition files that are loaded automatically.
The generated code looks like this:
declare module Models {
export class LoginModel {
password: string;
rememberMe: boolean;
userName: string;
}
}
In my component, I can access Models.LoginModel just fine and it doesn't give me any compiler errors (using Visual Studio).
However, when I try and run it, I get:
EXCEPTION: Error: Uncaught (in promise): EXCEPTION: Error in :0:0
ORIGINAL EXCEPTION: ReferenceError: Models is not defined
ORIGINAL STACKTRACE:
ReferenceError: Models is not defined
at new LoginComponent
Here is my LoginComponent:
import { Component } from 'angular2/core';
@Component({
selector: 'login',
templateUrl: './app/login/login.html'
})
export class LoginComponent {
model: Models.LoginModel = new Models.LoginModel();
}
What am I doing wrong here?