Skip to content

Commit

Permalink
fix (k,v) in o bugs with falsy values and updates
Browse files Browse the repository at this point in the history
  • Loading branch information
vprimachenko committed Oct 28, 2015
1 parent ebfac85 commit 125b655
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/directives/public/for.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,9 @@ module.exports = {
if (key) {
frag.scope.$key = key
}
// update interator
// update iterator
if (iterator) {
frag.scope[iterator] = key || i
frag.scope[iterator] = key !== null ? key : i
}
// update data for track-by, object repeat &
// primitive values.
Expand Down Expand Up @@ -218,7 +218,7 @@ module.exports = {
_.define(scope, '$key', null)
}
if (this.iterator) {
_.defineReactive(scope, this.iterator, key || index)
_.defineReactive(scope, this.iterator, key !== null ? key : index)
}
var frag = this.factory.create(host, scope, this._frag)
frag.forId = this.id
Expand Down

0 comments on commit 125b655

Please sign in to comment.