AngularJS Forms

Topics 

  • Forms 
  • Two-way databinding between form and model 
  • Built-in CSS styles
  • Form submission 
  • Form and element states 
  • Validation 
  • Show and hide 
    • ng-show, ng-hide 
    • ng-enabled, ng-disabled

Forms

What is a Form and Input Elements? 

  • A Form is a collection of input elements (input, select, textarea) for the purpose of grouping them together 
    • Input elements are ways for a user to enter data 
  • Form and input elements provide validation services, so that the user can be notified of invalid input before submitting a form 
    • Provides a better user experience than server-side validation alone because the user gets instant feedback on how to correct the error 
    • The value of ngModel won't be set unless it passes validation for the input fields 
  • Typically you want to disable browser's native validation through “novalidate” attribute

 

Download course content