Skip to content

Instantly share code, notes, and snippets.

@Carsak
Last active July 16, 2020 16:46
Show Gist options
  • Save Carsak/63e0de62936358cd6b10e11baf5a1643 to your computer and use it in GitHub Desktop.
Save Carsak/63e0de62936358cd6b10e11baf5a1643 to your computer and use it in GitHub Desktop.
Создание формы Ангуляр
Import { FormGroup, FormBuilder } from '@angular/forms';
export class MyFormPage {
myForm: FormGroup;
constructor(
private fb: FormBuilder,
) {
}
private createForm() {
this.myForm = this.fb.group({
fio: ['', [Validators.required]],
email: ['', [Validators.required, Validators.email]],
phone: ['', Validators.required],
});
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment