Nuñito Calzada
Nuñito Calzada

Reputation: 2136

Thymeleaf , JQuery and messages properties

I have a basic SpringBoot app. using Spring Initializer, embedded Tomcat, Thymeleaf template engine, and package as an executable JAR file.

I have this message in my message.properties

resetPassword.sending.email=Sending email

I want to use it in the HTML,

$("#sendEmailButtonId").click(function(e) {
    $("#emailLabelId").text([[#{resetPassword.sending.email}]]);
});

but it does not replace the text

Upvotes: 1

Views: 2233

Answers (1)

Metroids
Metroids

Reputation: 20487

Add <script th:inline="javascript"> in the surrounding script block for thymeleaf to parse [[${...}]] expressions.

Upvotes: 2

Related Questions