javascript 안에서 thymeleaf(타임리프) 빨간줄 표시 날 때

김희주·2023년 2월 1일
0

자잘한 Tip

목록 보기
5/8
post-thumbnail

자바스크립트에서 Thymeleaf 값을 가져오려는 경우

var test = [[${sample}]];

이런 식으로 사용하려고 하면 ',' expected 에러가 발생하는데

var test = /*[[${sample}]]*/'기본값';

이런 식으로 사용해주면
정상적으로 Thymeleaf 값을 가져와서
사용할 수 있다

출처 : https://wakestand.tistory.com/826

profile
백엔드 개발자입니다 ☘

0개의 댓글