I have a page that uses a parameterized data loader that may, or may not, return any rows. If it does, basically I want to show the page, and if it doesn’t I just want to display a message “not enough data available” kind of thing. I’m not new to JS, but I’m not an expert either, especially when it comes to front end JS so I’m likely just missing something.
When I’ve tried a conditional template, it seems to break when the content I want to conditionally show goes longer than one line; e.g. this works fine:
${ mydata.length==0 ? Not enough data
? Enough data!
}
But if I try to put several (or any more than one) lines of markdown, HTML etc where it says “Enough data” Observable framework simply shows the conditional code in the browser. I suppose I could “wrap” every line of markdown this way, but that sounds time consuming and difficult to maintain. Thoughts?