Skip to content
This repository has been archived by the owner on Sep 6, 2022. It is now read-only.

Nested Sub-Expression Support #171

Open
eliasthompson opened this issue Sep 26, 2015 · 7 comments
Open

Nested Sub-Expression Support #171

eliasthompson opened this issue Sep 26, 2015 · 7 comments

Comments

@eliasthompson
Copy link

With Meteor 1.2 came a Spacebars upgrade that allows nested sub-expressions.

{{asDollars (getArrayObjectKeySum (listActiveSegmentsWithOpportunity this.segment this.opportunity) 'oppMoveRevenue')}}

These work fantastic in Spacebar files but do not seem to work in Jade files. Any chance we could see support for this?

@alvin
Copy link

alvin commented Sep 28, 2015

+1 !

@saturnaut
Copy link

+1 ... Really need this support.

@eliasthompson
Copy link
Author

Looks like this was fixed with 0.4.4. Thanks!

@eliasthompson
Copy link
Author

Actually gonna reopen this since it looks like we still can't use them in Jade conditionals. For example:

if countArray (listResults _id)

... returns nothing but errors:

=> Errors prevented startup:

   While building the application:
   client/test.tpl.jade: Jade syntax error: Expected
   `)`
   ...rray (listResults _id}}
   ^

=> Your application has errors. Waiting for file change.

@eliasthompson eliasthompson reopened this Oct 22, 2015
@eliasthompson
Copy link
Author

Update: Appears to only fail if the last character in the line is a closing parenthesis. While the above expression does not work, the one below does.

if countArray (listResults _id) 'asc'

@eliasthompson
Copy link
Author

Another update. Because of the exception I found above, if you have a statement that ends with a subexpression, just passing null after it should make it work.

 if countArray (listResults _id) null

A hack-ish workaround, but the best we can do until the bug is fixed. Will leave this open until it's addressed.

@nesvet
Copy link

nesvet commented Jan 11, 2016

Hey there, +1 :-)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants