Closed halgorithm closed 11 years ago
However, the difference between these two is that Handlebar's way makes bar become this within the "bar" template. This allows the "bar" template to use {{name}} and {{whatever}} instead of {{bar.name}} and {{bar.whatever}}. How could you do that with blade?
Answer: you can't do that with Blade. It is a fundamental difference between Blade and Handlebars.
Also, is there any way to expose a local under a different name, like include "bar" exposing { coolBar: bar } or include "bar" exposing bar as "coolBar"? Not sure what the syntax would be, or if that would even be the right way to accomplish such a thing...
You also cannot really rename the locals. The only way would be something like this:
- var foo = bar
include "abc" exposing foo
... instead of just exposing bar
, you expose foo
, effectively renaming the local.
Closing this issue for now.
According to https://github.com/bminer/node-blade/wiki/Using-Blade-with-Meteor,
might look like this in Blade:
However, the difference between these two is that Handlebar's way makes
bar
becomethis
within the "bar" template. This allows the "bar" template to use{{name}}
and{{whatever}}
instead of{{bar.name}}
and{{bar.whatever}}
. How could you do that with blade?Also, is there any way to expose a local under a different name, like
include "bar" exposing { coolBar: bar }
orinclude "bar" exposing bar as "coolBar"
? Not sure what the syntax would be, or if that would even be the right way to accomplish such a thing...