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

Commit

Permalink
Merge pull request #24 from tlastad/master
Browse files Browse the repository at this point in the history
fixed removeFromValidationSummary to also remove from 'local' array
  • Loading branch information
ghiscoding committed Apr 9, 2015
2 parents 745dc24 + db3de37 commit 6c419d4
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/validation-common.js
Original file line number Diff line number Diff line change
Expand Up @@ -167,10 +167,15 @@ angular
* @param object validationSummary
* @param string elmName: element name
*/
function removeFromValidationSummary(validationSummary, elmName) {
var index = arrayFindObjectIndex(validationSummary, 'field', elmName); // find index of object in our array
// if message is empty, remove it from the validation summary
function removeFromValidationSummary(validationSummaryObj, elmName) {
var index = arrayFindObjectIndex(validationSummaryObj, 'field', elmName); // find index of object in our array
// if message is empty, remove it from the validation summary object
if(index >= 0) {
validationSummaryObj.splice(index, 1);
}
// also remove from 'local' validationSummary
index = arrayFindObjectIndex(validationSummary, 'field', elmName); // find index of object in our array
if(index >= 0) {
validationSummary.splice(index, 1);
}
}
Expand Down

0 comments on commit 6c419d4

Please sign in to comment.