Skip to content

Commit

Permalink
fixed angular v9 error
Browse files Browse the repository at this point in the history
  • Loading branch information
loiane committed Feb 10, 2020
1 parent 53d0ade commit 971d1c0
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion forms/src/app/data-form/data-form.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@
<div id="frameworks" class="row">
<div class="checkbox" class="col-sm-4"
formArrayName="frameworks"
*ngFor="let item of formulario.get('frameworks').controls; let i = index" >
*ngFor="let item of getFrameworksControls(); let i = index" >
<label class="checkbox-inline">
<input type="checkbox" [formControlName]="i"> {{ frameworks[i] }}
</label>
Expand Down
4 changes: 4 additions & 0 deletions forms/src/app/data-form/data-form.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -208,4 +208,8 @@ export class DataFormComponent extends BaseFormComponent implements OnInit {
return this.verificaEmailService.verificarEmail(formControl.value)
.pipe(map(emailExiste => emailExiste ? { emailInvalido: true } : null));
}

getFrameworksControls() {
return this.formulario.get('frameworks') ? (<FormArray>this.formulario.get('frameworks')).controls : null;
}
}
4 changes: 0 additions & 4 deletions forms/src/app/shared/base-form/base-form.component.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
import { Component, OnInit } from '@angular/core';
import { FormGroup, FormArray } from '@angular/forms';

@Component({
selector: 'app-base-form',
template: '<div></div>'
})
export abstract class BaseFormComponent implements OnInit {

formulario: FormGroup;
Expand Down

0 comments on commit 971d1c0

Please sign in to comment.