I tried declaring the variable in my JSP:
<script> var _csrf.token = "${_csrf.token}"; </script>
And then accessed it in my ts file in this code, below, it displayed the value correctly.
console.log(window['_csrf.token']);
However, I am getting an undefined on this scenario, my purpose is to hide it in the browser for security purpose.
I have this code on JSP
<c:set var="_csrf.token" value="${_csrf.token}" />
And tried to access on Angular .ts file using this code.
console.log(window['_csrf.token']);
Am I correct with using the jstl tag or not? I don't really know how. Can someone teach me how to get the value from the jsp to ts file?