Here are my 2 datas in a <div>
:
<div class="NP" id="sliced">{{app.user.Firstname}}{{app.user.Lastname}}</div>
I would like to slice these 2 datas so it displays the first letters of each string, in the div
.
Roughly, I would like to make some like:
{{app.user.Firstname.slice(0,2)}}{{app.user.Lastname.slice(0,2)}}
but I don't know how to implement JS or JQUERY into these things. I tried to attribute a script to the data, in vain
{{ app.user.firstName, {'label_attr' : {'script' : `$("#sliced").slice(0,2);`} }}
It returns me a punctuation error even if I only try to attr a simple class.