These are chat archives for ractivejs/ractive

29th
Jul 2015
Noel Quiles
@EnMod
Jul 29 2015 00:42

Thanks @MartinKolarik , @pantchox Martin's idea is pretty much what I had in mind, just didn't know how to phrase it :+1: I was trying something like that using a predefined function before, I still don't have the most firm grasp of how Ractive works:

{{#if arrayCheck(value)}}
    {{#array}}    {{.}}    {{/array}}
{{else}}
     {{string}}
{{/if}}

// in data:
arrayCheck: function(obj){
  if (obj.constructor === Array) {
    return true; 
  } else { 
    return false;
  }
}

Martin I'll be trying your solution very soon

This message was deleted