|
|
@@ -13,10 +13,10 @@ module.exports = {
|
|
|
if (inMatch) {
|
|
|
var itMatch = inMatch[1].match(/\((.*),(.*)\)/)
|
|
|
if (itMatch) {
|
|
|
- this.iterator = itMatch[1]
|
|
|
- this.alias = itMatch[2]
|
|
|
+ this.iterator = itMatch[1].trim()
|
|
|
+ this.alias = itMatch[2].trim()
|
|
|
} else {
|
|
|
- this.alias = inMatch[1]
|
|
|
+ this.alias = inMatch[1].trim()
|
|
|
}
|
|
|
this.expression = inMatch[2]
|
|
|
}
|
|
|
@@ -98,6 +98,7 @@ module.exports = {
|
|
|
var oldFrags = this.frags
|
|
|
var frags = this.frags = new Array(data.length)
|
|
|
var alias = this.alias
|
|
|
+ var iterator = this.iterator
|
|
|
var start = this.start
|
|
|
var end = this.end
|
|
|
var inDoc = _.inDoc(start)
|
|
|
@@ -121,6 +122,9 @@ module.exports = {
|
|
|
// update $key
|
|
|
if (key) {
|
|
|
frag.scope.$key = key
|
|
|
+ if (iterator) {
|
|
|
+ frag.scope[iterator] = key
|
|
|
+ }
|
|
|
}
|
|
|
// update data for track-by, object repeat &
|
|
|
// primitive values.
|