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

Commit 365cd17

Browse files
committed
Reset isolatedScope on route change
1 parent 93adbe1 commit 365cd17

File tree

6 files changed

+16
-11
lines changed

6 files changed

+16
-11
lines changed

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "angular-validation-ghiscoding",
3-
"version": "1.3.32",
3+
"version": "1.3.33",
44
"author": "Ghislain B.",
55
"description": "Angular-Validation Directive and Service (ghiscoding)",
66
"main": [

changelog.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,5 @@ Angular-Validation change logs
3333
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
3434
1.3.30 (2015-06-15) Merged pull request #40 - Polish translations
3535
1.3.31 (2015-06-20) Enhancement #39 - How to Reset a Form, added Protractor tests to cover this new functionality.
36-
1.3.32 (2015-06-24) Merged pull request #41 and fixed errors inside it, updated Protractor test as well.
36+
1.3.32 (2015-06-24) Merged pull request #41 and fixed errors inside it, updated Protractor test as well.
37+
1.3.33 (2015-07-02) Reset isolatedScope on route change

dist/angular-validation.min.js

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "angular-validation-ghiscoding",
3-
"version": "1.3.32",
3+
"version": "1.3.33",
44
"author": "Ghislain B.",
55
"description": "Angular-Validation Directive and Service (ghiscoding)",
66
"main": "app.js",

readme.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#Angular Validation (Directive / Service)
2-
`Version: 1.3.32`
2+
`Version: 1.3.33`
33
### Form validation after user inactivity of default 1sec. (customizable timeout)
44

55
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!
@@ -17,7 +17,7 @@ Huge rewrite to have a better code separation and also adding support to Service
1717

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

20-
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 ;)
20+
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 ;)
2121

2222
<a name="plunker"></a>
2323
## Live Demo

src/validation-common.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,13 @@ angular
2222
// watch on route change, then reset some global variables, so that we don't carry over other controller/view validations
2323
$rootScope.$on("$routeChangeStart", function (event, next, current) {
2424
if (!_bypassRootScopeReset) {
25-
_globalOptions.displayOnlyLastErrorMsg = false;
26-
_formElements = []; // array containing all form elements, valid or invalid
27-
_validationSummary = []; // array containing the list of invalid fields inside a validationSummary
25+
_globalOptions.displayOnlyLastErrorMsg = false; // reset the option of displaying only the last error message
26+
_globalOptions.preValidateFormElements = false; // reset the option of pre-validate all form elements, false by default
27+
_globalOptions.isolatedScope = null; // reset used scope on route change
28+
_globalOptions.scope = null; // reset used scope on route change
29+
30+
_formElements = []; // array containing all form elements, valid or invalid
31+
_validationSummary = []; // array containing the list of invalid fields inside a validationSummary
2832
}
2933
});
3034

0 commit comments

Comments
 (0)