Open ultraq opened 6 years ago
The message expression is one that would be really handy. I will have a look on how we can implement it
How would we do a .substring now?
I think you can do a .substring
on any string now as both Java and JavaScript both call that method "substring". I haven't tried it with that method in particular, but being able to do method calls on objects is already possible.
alright!
Hi, I have a problem
let templateEngine = new TemplateEngine({
...STANDARD_CONFIGURATION,
messageResolver: async (key, parameters) => resolveMessage(key, lang, 'defaultMessage')
})
const context = { user: user } templateEngine.processFile(fileName, context)
, it work on tags loike this with #
, but not on variable expressions
Dear
, this results in - Dear{0} The templates I have worked fine with spring thymeleaf Did I forget something ?
A list of the expression syntaxes currently supported in the latest version of ThymeleafJS. The full list of expression syntaxes was taken from the Thymeleaf docs here: https://www.thymeleaf.org/doc/tutorials/3.0/usingthymeleaf.html#standard-expression-syntax
Simple expressions
${...}
*{...}
#{...}
@{...}
~{...}
Complex expressions
Literals
'one text'
,'Another one!'
,...0
,34
,3.0
,12.3
,...true
,false
null
one
,sometext
,main
,...Text operations
+
|The name is ${name}|
Arithmetic operations
+
,-
,*
,/
,%
-
Boolean operations
&&
and
||
or
!
not
Comparisons and equality
>
<
>=
<=
gt
lt
ge
le
==
,===
!=
,!==
eq
ne
Conditional operators
(if) ? (then)
(if) ? (then) : (else)
(value) ?: (defaultvalue)
Special tokens
_