I am new to angularJS2.It might be a dummy question for you I searched many forums and failed about getting input value to json value in typeScript. You know how I should write my submit() function to get input values from screen and console it to screen when I click submit button? You can find the codes below. Please let me know if you have inquiries .
Regards
<!DOCTYPE html>
<html>
<form name="myForm" ng-submit="submit()">
<head>
<link rel="stylesheet" href="guiTransformatorStyles.css">
</head>
<body>
<table>
<br>
<ul class="nav nav-pills nav-stacked">
<tr><td> <input type="text" value=" " ng-model="myForm.productName"> </td></tr>
</ul>
</table>
</body>
</form>
</html>
This is my typeScript file :
import { Component, OnInit} from '@angular/core';
import { Router } from '@angular/router';
import { FormGroup, FormBuilder } from '@angular/forms';
import { Http } from '@angular/http';
@Component({
moduleId: module.id,
templateUrl: 'navigation.component.html',
host: {'(window:keydown)' : 'hotkeys($event)'},
})
export class NavigationComponent implements OnInit {
form: FormGroup;
ngOnInit(): void { }
constructor(private router: Router) {
}
submit() {
alert('submit');
}
}
ng-modelandng-submitare AngularJS syntax....