Template7 variables with spaces question

Hello

I have a small question regarding the printing of some variables contained in a json with spaces in some keys
I will try to explain my trouble. This is part of my JSON

......
"ipotesi" : [ 
                {
                "id" : "AB1",
                "title" : "Info title #1",
               "value space":  {
                    "min" : 12.00,
                    "max" : 23.00
                }
              },
             {
                "id" : "CD2",
                "title" : "Info title #2",
               "value space":  {
                    "min" : 5.00,
                    "max" : 19.00
                }
              },
]
.....

in my JS i set

...
    self.ipotesi = data.ipotesi;
    self.$update();
...

In my template

...
    {{#each ipotesi}}
        <div class="card padding">{{title}}<br />
        Min [min variable] // Max [max variable]
        </div>
    {{/each}}
...

how can print “value space” min and max in template? obviously {{value space.min}} and {{value space.max}} doesn’t work

Thanks in advace!!!

1 Like

You try with %20 like Is use un URL links.
Also **  ** but i think it didn’t work.

I didn’t try, just a suggestion.

unfortunately neither of the 2 solutions works :disappointed:

{{js "this['value space'].min"}}
1 Like

thanks @nolimits4web, works perfectly

but sometimes this[‘value space’] is null, min and max are not available, and i got exception

Uncaught TypeError: Cannot read property 'min' of null
    at Object.eval (eval at js (template7.esm.js:NaN), <anonymous>:1:45)

i’ve tried with

{{#js_if "this['value space'] != 'null'"}}{{js "this['value space'].min"}} {{js "this['value space'].min"}} {{/if}}

and

{{#js_if "!!this['value space']"}}{{js "this['value space'].min"}} {{js "this['value space'].min"}} {{/if}}

but it doesn’t work

NULL with Template7 : problem is known: https://github.com/nolimits4web/template7/issues/70 OR https://github.com/nolimits4web/template7/issues/74 and (may be) : https://github.com/nolimits4web/template7/pull/73

thanks @shastox
so we have to wait @nolimits4web to commit patch and have new release

Nothing to patch, this is how JS works, use conditional checks, helpers, etc.

{{js "this['value space'] ? this['value space'].min : '' "}}

Разговор о другом:

const obj = {key : null}

Как проверить в Template7 что это именно null? Вот так не работает:

{{#js_if "this.obj.key === null"}}

А вот такой вариант не подойдет, так как тут может быть ноль, пустая строка или false:

{{js "this.obj['key'] ? '...' : '...'"}}