Schlipak/Yoru

How to implement a similar construction

Closed this issue · 4 comments

wku commented

How to implement a similar construction
ng-repeat - angularjs ?

Thanks for your interest in Yoru ! Right now most of that sort of logic can be handled through Handlebars, using the each helper like so

{{#each collection as |item|}}
  {{item}}
{{/each}}

Although currently Yoru is quite unstable, as it is just a side project I'm working on for fun.

wku commented

Yes excellent, thanks
But how to do so ng-if angular ? if (2!=3)

  • And even where to look at all existing operators (and their syntax)?

Handlebars does not have operators, but uses helpers written in a lisp-like syntax. For your specific example you could do something like

{{#if (not-equal 2 3)}}
  ...
{{/if}}

Thought that might require writing the not-equal helper in the first place. You can do so by calling Yoru.Handlebars.registerHelper before booting the app. The Handlebars doc explains pretty well how to write helpers.

I'll reiterate again though that Yoru is unstable and not production ready. I haven't taken the time to test nor document it, but you can check out the examples directory and run the app inside for a basic demo ;)

wku commented

Ok thanks