Html template how to check if?

How to check variable {[if }} in salsone? For example the variable {{.auth}} == 1
July 9th 19 at 13:39
2 answers
July 9th 19 at 13:41
if owned in the html templates/template - Reta76 commented on July 9th 19 at 13:44
{{if .auth == "1"}}
{{else}}
{{end}}

does not work as expected - Reta76 commented on July 9th 19 at 13:47
: I can't understand the question - Kali58 commented on July 9th 19 at 13:50
July 9th 19 at 13:43
{{if eq .auth 1}}
doesn't work if load the part with the condition by using {{template "head.html" }} - Reta76 commented on July 9th 19 at 13:46
Sample code here please https://play.golang.org/ - Reta76 commented on July 9th 19 at 13:49
I suppose that in {{template "head.html" }} it is necessary to transmit not only the name of the template, but the list of variables which should be visible in head.html... built-in templates have not tried it, but in other languages it is usually the case. - Kali58 commented on July 9th 19 at 13:52

Find more questions by tags Go