Closed Mytia closed 5 years ago
Hi Mytia.
Yes, that is true - the ~ operator is not supported in template expressions. But here is a possible update, which could support it.
How does that work for you? It should now support ~(x)
~ x
and for contextual parameters, ~y
you can write ~(~y)
or ~ ~y
or ~~y
I'm not sure what you mean by It also does not work correctly for object properties without brackets.. Can you give an example?
New version works fine. I just mean that ~(x) works but ~x don't (without space). ~ ~x can be breaking after templates minification, so in production better to use brackets.
Yes ~x is assumed to be a helper. To use the ~ operator on a non-helper path such as x, you need to write ~ x or ~(x).
~ ~x
shouldn't break on minification since it is not within javascript code. It is within the template, so either a string (of HTML markup) or within a script block. In both cases, white-space is preserved. And the compiled template will not include that ~ ~x
string, and should minify fine...
This has been fixed in release v0.9.91.
As I understand the first '~' operator is ignored. It also does not work correctly for object properties without brackets.
https://jsfiddle.net/nq4372t8/68/