Example:
<App>
<JavaScript>
var Observable = require("FuseJS/Observable");
var items = Observable();
items.add({"id":"","name":"Zero"});
items.add({"id":"1","name":"One"});
items.add({"id":"2","name":"Two"});
module.exports = {
items:items,
};
</JavaScript>
<StackPanel>
<Each Items="{items}">
<Text Value="{name}" />
</Each>
</StackPanel>
</App>
Result:
Zero
One
Two
Example 2:
<App>
<JavaScript>
var Observable = require("FuseJS/Observable");
var items = Observable();
items.add({"id":"","name":"Zero"});
items.add({"id":"1","name":"One"});
items.add({"id":"2","name":"Two"});
module.exports = {
items:items,
};
</JavaScript>
<StackPanel>
<Each Items="{items}">
<WhileString Value="{id}" Equals="" Invert="true">
<Text Value="{name}" />
</WhileString>
</Each>
</StackPanel>
</App>
Result 2:
Two
One
I would have expected the result to be
One
Two
but it’s upside down now, only because of checking if {id} isn’t empty.
This behaviour doesn’t seem right to me. Is there an explanation for it?
Edit:
<WhileString Value="{id}" Test="IsNotEmpty">
has the same effect by the way.