Created
June 27, 2022 18:37
-
-
Save wpflames/fd8cfe54b14fbc0dbcff9a2c302ea19a to your computer and use it in GitHub Desktop.
Form validation - Checkbox, dropdown, text field
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { Component } from '@angular/core'; | |
| @Component({ | |
| selector: 'course-form', | |
| templateUrl: './course-form.component.html', | |
| styleUrls: ['./course-form.component.scss'] | |
| }) | |
| export class CourseFormComponent { | |
| categories = [ | |
| { id: 1, name: 'Development'}, | |
| { id: 2, name: 'Art'}, | |
| { id: 3, name: 'Languages'} | |
| ]; | |
| log(x) { console.log(x); } | |
| submit(f){ | |
| console.log(f); | |
| console.log(f.value.contact.courseName); | |
| console.log(f.value.categoryName.name); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment