While working with forms, we might find useful to reuse common parts in different forms. For example, the fields to collect the address information of a person could be reused in many different cases. AngularJS allows us to define subforms that we can nest inside regular forms.
In the example you can see that we've defined a form inside our main index.html page and a subform inside addressForm.html. The subform is nested inside the main form with the ng-include directive. To define a subform we have to use the ng-form directive and assign it a name. All the elements inside the subform are grouped together: as you can see, if we want to access the validity state of the zip field inside the subform, we have to write personForm.addressForm.zip.$valid because the addressForm is part of personForm and all the fields inside the subform (like zip) are part of the addressForm object. The subform have it's own validity (addressForm.$valid and addressForm.$invalid) and modification states (addressForm.$pristine and addressForm.$dirty) that are automatically merged with the other elements of the containing form to have the global validity and modification states of the main form.
Both the containing form and the subform can work on the same model variable defined on the scope. In this case we see that the model variable person that we've defined in the script file is used by both the forms so it can be automatically updated like if it was inside a single form.
When you use the ng-include directive, remember to wrap the external file name in single quotes if it's a string constant, otherwise, if you don't include the quotes, your string in the src attribute will be interpreted as an expression that must evaluate to a URL.