Skip to content

Commit 39c4e49

Browse files
Shuwen Qiananthonykoerber
authored andcommitted
mm-repeater.validate returns a boolean
1 parent c663bf7 commit 39c4e49

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

src/mm-repeater/mm-repeater.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,6 @@
4141
}
4242
},
4343

44-
// Track added
45-
// Track deleted
46-
// changed = ∆( {orig} - {deleted}, {current} - added )
47-
4844
behaviors: [
4945
StrandTraits.Refable,
5046
StrandTraits.Resolvable
@@ -131,6 +127,8 @@
131127
},
132128

133129
validate: function() {
130+
var allValid = true;
131+
134132
this.data.forEach(function(item, index) {
135133
var valid = true;
136134

@@ -157,7 +155,11 @@
157155
this.set('data.'+index+'.error', !valid);
158156
this.set('data.'+index+'.errorMessage', item.errorMessage);
159157

158+
allValid = allValid && valid;
159+
160160
}, this);
161+
162+
return allValid;
161163
},
162164

163165
validation: this.validate,

0 commit comments

Comments
 (0)