meteor-jade icon indicating copy to clipboard operation
meteor-jade copied to clipboard

Jade seems not to handle if statement with Template.subscriptionsReady helper

Open alexofob opened this issue 9 years ago • 3 comments

Hi There,

I just got tripped by jade and I still haven't recovered. Having spent so much time to debug what the issue was, I found jade was the culprit.

Below is just an illustration of my code:

template(name="form") if Template.subscriptionsReady p Hehehe

else
  p  Loading

For some reason eventhough subscriptions are ready I keep seeing Loading. When I convert to html/spacebars, it works fine.

I suspect that jade is not interpreting Template.subscriptionsReady correctly or it is not able to handle it.

Help!

alexofob avatar Jun 18 '15 16:06 alexofob

I answered you question on the meteor forum because I've seen it there first, but I guess it's more appropriate to continue the discussion here if my answer doesn't help.

https://forums.meteor.com/t/thoughts-on-using-jade-with-meteor/4810/14

mquandalle avatar Jun 18 '15 18:06 mquandalle

Yeah, you may be right. It could be my formatting, but I have tried the different approaches with | or p and still none works for me.

It may just be that I am not proficient with Jade enough since I am a bit new to it. I would appreciate if someone could also test this scenario with a real example aside the test case scenario.

Thanks.

alexofob avatar Jun 19 '15 10:06 alexofob

I too have come across the same question. if Template.subscriptionsReady doesn't do anything for me.

EDIT: It acts as if subscription is always ready, but in the console, I am waiting for sub

sangyoo91 avatar Oct 15 '15 11:10 sangyoo91