1. A Template Driven Form
- Make contacts creator component
- Add a new route
- Add a create contact method to the contacts service
- Add
ngModel and ngModelGroup to the form
- Add
ngSubmit and an ngForm for it to use
- Make a save method that calls the contacts service
2. Validators & Error Messages
- Add
required and minlength to the name input
- If the form isn't valid...
- ...disable the save button
- ...change the field color to red
- ...add an error message in the field which tells you the minlength required
- (refactor the contacts editor to use a template driven form too)
3. Add Custom Email Validator
- Make a new directive
- Write a validation function that takes a
FormControl and returns a certain object of the email is invalid
- Use the directive's
providers field to add it to NG_VALIDATORS
- Add directive selector to the email input