I need to pass a model attribute from controller to HTML. My application is using HTML5, thymeleaf & springboot.
I am using the below code snippet:
$(document).ready(function() {
var modelAttributeValue = '${modelAttribute}';
}
Code snippet from my controller:
model.addAttribute("modelAttribute", "viewEmployee")
But I am not able to get the value assigned to model attribute in HTML.
Please advise.
Thank you in advance.