Form changed tracking
Form changed tracking means deviation from the initial state of the form† indicates that a form changed. You can change a field and set it back to it's initial state and aaFormExtensions considers the field AND the form no longer changed (all values are equal to their init state†).
Angular considers the field/form dirty still since it was touched (yet changed back to initial state).
Form reset
Sets the state of the form back to it's original state†:
Reset initial form state
The current state of the form will be considered it's initial state (any changes from here are now $changed):
†AFTER AJAX. All native Angular AJAX requests are counted by aaLoadingWatcher and a form isn't considered loaded until pending AJAX requests have completed. If you have other types of loading to account for simply use aaLoadingWatcher.increment()/.decrement() API to count them.
Loading indicators
isLoading boolean is available from aaLoadingWatcher.isLoading factory or:
$rootScope.aaIsLoading = {{ aaIsLoading }}
On-navigate away handling
Includes (by default, overridable) detection of Angular UI Router $stateChangeStart AND native DOM beforeunload. If the root form in the view is myForm.$aaFormExtensions.$changed it will block with a JavaScript confirm. Please customize this with however you are doing modals for the UI Router case. I would recommend this. Then register your own custom strategy:
Source for this example page
//current variable status
personForm.$valid = {{ personForm.$valid }}
personForm.$aaFormExtensions.$changed = {{ personForm.$aaFormExtensions.$changed}}
personForm.$aaFormExtensions.$childForms.length = {{ personForm.$aaFormExtensions.$childForms.length }}
personForm.$aaFormExtensions.$invalidAttempt = {{ personForm.$aaFormExtensions.$invalidAttempt}}
//current variable status
addressForm.$valid = {{ addressForm.$valid }}
addressForm.$aaFormExtensions.$changed = {{ addressForm.$aaFormExtensions.$changed }}
addressForm.$aaFormExtensions.$childForms.length = {{ addressForm.$aaFormExtensions.$childForms.length }}
addressForm.$aaFormExtensions.$invalidAttempt = {{ addressForm.$aaFormExtensions.$invalidAttempt }}
| First Name | Last Name | |||
|---|---|---|---|---|
| {{ friend.firstName }} | {{ friend.lastName }} |
Customizing Labels
You can customize label sizes and add classes to them