Skip to content
This repository has been archived by the owner on Jul 1, 2020. It is now read-only.

Commit

Permalink
Reset isolatedScope on route change
Browse files Browse the repository at this point in the history
  • Loading branch information
ghiscoding committed Jul 2, 2015
1 parent 93adbe1 commit 365cd17
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 11 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "angular-validation-ghiscoding",
"version": "1.3.32",
"version": "1.3.33",
"author": "Ghislain B.",
"description": "Angular-Validation Directive and Service (ghiscoding)",
"main": [
Expand Down
3 changes: 2 additions & 1 deletion changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,5 @@ Angular-Validation change logs
1.3.29 (2015-06-10) Added RemoveValidator() for Directive, added Protractor tests on RemoveValidator() for both the Directive and Service. Fixed ngDisabled not working correctly in Service, added Protractor tests for ngDisabled On/Off in both Directive and Service
1.3.30 (2015-06-15) Merged pull request #40 - Polish translations
1.3.31 (2015-06-20) Enhancement #39 - How to Reset a Form, added Protractor tests to cover this new functionality.
1.3.32 (2015-06-24) Merged pull request #41 and fixed errors inside it, updated Protractor test as well.
1.3.32 (2015-06-24) Merged pull request #41 and fixed errors inside it, updated Protractor test as well.
1.3.33 (2015-07-02) Reset isolatedScope on route change
6 changes: 3 additions & 3 deletions dist/angular-validation.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "angular-validation-ghiscoding",
"version": "1.3.32",
"version": "1.3.33",
"author": "Ghislain B.",
"description": "Angular-Validation Directive and Service (ghiscoding)",
"main": "app.js",
Expand Down
4 changes: 2 additions & 2 deletions readme.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#Angular Validation (Directive / Service)
`Version: 1.3.32`
`Version: 1.3.33`
### Form validation after user inactivity of default 1sec. (customizable timeout)

Forms Validation with Angular made easy! Angular-Validation is an angular directive/service with locales (languages) with a very simple approach of defining your `validation=""` directly within your element to validate (input, textarea, etc) and...that's it!!! The directive/service will take care of the rest!
Expand All @@ -17,7 +17,7 @@ Huge rewrite to have a better code separation and also adding support to Service

For more reasons to use it, see the answered question of: [Why Use It?](#whyuseit)

If you do use Angular-Validation, please click on the **Star** and add it as a favourite. The more star ratings there is, the more chances it could be found by other users inside the popular trend section. That is the only support I ask you... thanks ;)
If you like the Angular-Validation project and you use it, please click on the **Star** and add it as a favourite. The more star ratings there is, the more chances it could be found by other users inside the popular trend section. That is the only support I ask you... thanks ;)

<a name="plunker"></a>
## Live Demo
Expand Down
10 changes: 7 additions & 3 deletions src/validation-common.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,13 @@ angular
// watch on route change, then reset some global variables, so that we don't carry over other controller/view validations
$rootScope.$on("$routeChangeStart", function (event, next, current) {
if (!_bypassRootScopeReset) {
_globalOptions.displayOnlyLastErrorMsg = false;
_formElements = []; // array containing all form elements, valid or invalid
_validationSummary = []; // array containing the list of invalid fields inside a validationSummary
_globalOptions.displayOnlyLastErrorMsg = false; // reset the option of displaying only the last error message
_globalOptions.preValidateFormElements = false; // reset the option of pre-validate all form elements, false by default
_globalOptions.isolatedScope = null; // reset used scope on route change
_globalOptions.scope = null; // reset used scope on route change

_formElements = []; // array containing all form elements, valid or invalid
_validationSummary = []; // array containing the list of invalid fields inside a validationSummary
}
});

Expand Down

0 comments on commit 365cd17

Please sign in to comment.