fix(examples): make them work with noImplicitAny and declarations:true

This commit is contained in:
Tobias Bosch
2016-09-14 09:41:40 -07:00
parent 1a035a0dc7
commit 0b9425bbb4
3 changed files with 9 additions and 9 deletions

View File

@ -15,10 +15,10 @@ import {FormControl, FormGroup, Validators} from '@angular/forms';
template: `
<form [formGroup]="form" (ngSubmit)="onSubmit()">
<div *ngIf="first.invalid"> Name is too short. </div>
<input formControlName="first" placeholder="First name">
<input formControlName="last" placeholder="Last name">
<button type="submit">Submit</button>
</form>
<button (click)="setValue()">Set preset value</button>
@ -30,7 +30,7 @@ export class SimpleFormGroup {
last: new FormControl('Drew'),
});
get first() { return this.form.get('first'); }
get first(): any { return this.form.get('first'); }
onSubmit(): void {
console.log(this.form.value); // {first: 'Nancy', last: 'Drew'}