I'm submitting a bug report
Library Version:
1.1.2
Operating System:
Windows 10
Node Version:
6.10.2
NPM Version:
5.0.3
Aurelia CLI OR JSPM OR Webpack AND Version
CLI 0.30.0 (System.js + ESNext)
Browser:
all
Language:
ESNext
Current behavior:
passing $parent variable to a valueConverter throws an exception.
I'm able to access the $parent variable from a loop, and I'm also able to access his properties.
Expected/desired behavior:
I should be able to pass the $parent variable to a valueConverter as if it was a regular variable.
I also created a gist to demonstrate the problem.
(but i'm not sure what version of the framework is running in the gist)
https://gist.run/?id=86fc278d3837718be4691acd5625aaad
you need to uncomment the buggy line to show the error in the console.
any news?
I'm betting this is a parser error, where the parser thinks it is beginning another ${ ... } block.
In the meantime, here's a hack that can get around this: https://gist.run/?id=f5a165c276274f868256f0a849c55b8c
<div repeat.for="i of arr">
<div ref="temp" parent.bind="$parent"></div>
$parent with conveter = ${ temp.parent | stringify}
</div>
@jdanyow here's the line where things fail: https://github.com/aurelia/binding/blob/048c8dd217fffbf53276e9d65745d2fd10af6686/src/parser.js#L327
In parseAccessOrCallScope, I'm betting if we add a this.peek.text === '|' and this.peek.text === '&' to that if statement things will work.
Working on PR
Most helpful comment
Working on PR