fix(examples): make them work with `noImplicitAny` and `declarations:true`
This commit is contained in:
parent
1a035a0dc7
commit
0b9425bbb4
|
@ -11,7 +11,7 @@ declare var expect: any;
|
|||
|
||||
// TODO (juliemr): remove this method once this becomes a protractor plugin
|
||||
export function verifyNoBrowserErrors() {
|
||||
browser.manage().logs().get('browser').then(function(browserLog) {
|
||||
browser.manage().logs().get('browser').then(function(browserLog: any[]) {
|
||||
var errors: any[] = [];
|
||||
browserLog.filter(logEntry => {
|
||||
var msg = logEntry.message;
|
||||
|
|
|
@ -15,15 +15,15 @@ import {FormControl, FormGroup, Validators} from '@angular/forms';
|
|||
template: `
|
||||
<form [formGroup]="form" (ngSubmit)="onSubmit()">
|
||||
<p *ngIf="name.invalid">Name is invalid.</p>
|
||||
|
||||
|
||||
<div formGroupName="name">
|
||||
<input formControlName="first" placeholder="First name">
|
||||
<input formControlName="last" placeholder="Last name">
|
||||
</div>
|
||||
</div>
|
||||
<input formControlName="email" placeholder="Email">
|
||||
<button type="submit">Submit</button>
|
||||
</form>
|
||||
|
||||
|
||||
<button (click)="setPreset()">Set preset</button>
|
||||
`,
|
||||
})
|
||||
|
@ -36,9 +36,9 @@ export class NestedFormGroupComp {
|
|||
email: new FormControl()
|
||||
});
|
||||
|
||||
get first() { return this.form.get('name.first'); }
|
||||
get first(): any { return this.form.get('name.first'); }
|
||||
|
||||
get name() { return this.form.get('name'); }
|
||||
get name(): any { return this.form.get('name'); }
|
||||
|
||||
onSubmit() {
|
||||
console.log(this.first.value); // 'Nancy'
|
||||
|
|
|
@ -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'}
|
||||
|
|
Loading…
Reference in New Issue