I am using AngularJS and Typescript.
I got a problem trying to access the form object.
Following is my HTML
<form name="myForm" novalidate>
<label>First Name</label>
<input type="text" ng-model="frm.FirstName" name="FirstName" />
<button ng-click="logit()"></button>
</form>
Now i want to access the frm object my typescript code is as follows
module TestCtrl{
interface ITestController{
logit(): any;
}
class TestController implements ITestController{
frm: any;
constructor() {
var vm = this;
var frm = {};
}
logit(){
var vm;
console.log(frm.FirstName);
}
}
angular.module('app').controller('TestCtrl', TestController);
}
The console says frm is not defined. Any ideas?
this.frm.FirstName. Your typescript compiler should have catched this error