// vim: set tw=80 ts=2 sw=2 sts=2 : import { AfterViewChecked, Component, EventEmitter, Input, Output, ViewChild } from '@angular/core'; import { NgForm } from '@angular/forms'; import { Logger } from '@nsalaun/ng-logger'; import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'; import { Account } from './account'; @Component({ selector: 'account-form', template: `

The account name is required.

.00€

The authorized overdraft is required.

The authorized overdraft must be less than or equal to 0.

` }) export class AccountFormComponent implements AfterViewChecked { @Input() account: Account; @Output() onValid: EventEmitter = new EventEmitter(); @ViewChild('form') form: NgForm; constructor() {} ngAfterViewChecked() { this.onValid.emit(this.form.form.valid); } }