Closed UppaJung closed 8 months ago
My workaround for problems like title
being undefined has been to make sure everything that uses the template has an empty string assigned to title
title:
Yes, this is how JavaScript works and I think there's no way to call an undefined variable without throwing an error.
If you don't care if a variable is defined or not, use {{ it.varname }}
instead of {{ varname }}
. The it
global variable contains all defined variables.
As of #43, this issue is fixed. @UppaJung give it a try once the new version is published.
Vento (via the JS enginge?) throws an exception if a value isn't defined.
Hence, if
a
is undefined andb
is set to "foo
", one would expecta ?? b
ora || b
to result infoo
, but instead it results in an exception.