AEM-Rules-for-SonarQube icon indicating copy to clipboard operation
AEM-Rules-for-SonarQube copied to clipboard

Use data-sly-unwrap to Avoid Code Duplication

Open piotr-wilczynski opened this issue 6 years ago • 0 comments

Remember that you can use data-sly-unwrap. A lot of code can be saved by using it proficiently.

<!--/* Bad */-->
<a href="${model.url} data-sly-test="${model.url}">${model.text}</a>
<sly data-sly-test="${!model.url}">${model.text}</sly>
 
<!--/* Good */-->
<a href="${model.url} data-sly-unwrap="${!model.url}">${model.text}</a>

piotr-wilczynski avatar Oct 24 '18 10:10 piotr-wilczynski