BorisMoore / jsviews

Interactive data-driven views, MVVM and MVP, built on top of JsRender templates
http://www.jsviews.com/#jsviews
MIT License
856 stars 130 forks source link

Props Convert else statement not working #404

Closed treyseals closed 5 years ago

treyseals commented 6 years ago

When a props (or for) loop is converted with no results the else statement isn't being processed as expected.

{^{props list convert='filtered'}}
     {{>prop.name}}
{{else}}
     no results
{{/props}
BorisMoore commented 6 years ago

Thanks for calling this out. You are right. I'll have a fix for this in the next update, but if you want a local fix you can change this line:

https://github.com/BorisMoore/jsviews/blob/master/jsviews.js#L2447

from

var finalElse = !arguments.length,

to

var finalElse = !this.tagCtx.args.length,

Let me know if that doesn't work for you...

BorisMoore commented 5 years ago

This has been fixed in release v0.9.91.