Skip to main content
JakeCham
Level 6
September 10, 2021
Resuelto

ternary operator AEM

  • September 10, 2021
  • 2 respuestas
  • 1672 visualizaciones

Hi Team, 

I want to print a value (which is getting from the dialog) inside a ternary operator.

 

I'm able to use ternary operator like below and it works fine.

<a href="#" class="${properties.openinnewwindow ? 'nonunderline' : ''}">link</a>

 

But when I put it like below it is not working. Adding a value from the dialog ${properties.name}.

<a href="#" class="${properties.openinnewwindow ? '${properties.name}' : ''}">link</a>

 

Any suggestions would be appreciated.

Thank you.

 

 @Vijayalakshmi_S 

Este tema ha sido cerrado para respuestas.
Mejor respuesta de Vijayalakshmi_S

Hi @jakecham,

Small correction in the usage. 

It should be 

<a href="#" class="${properties.openinnewwindow ? properties.name : 'Default class'}">link</a>

2 respuestas

Vijayalakshmi_S
Level 10
September 10, 2021

Hi @jakecham,

Small correction in the usage. 

It should be 

<a href="#" class="${properties.openinnewwindow ? properties.name : 'Default class'}">link</a>
JakeCham
Level 6
September 10, 2021

Thanks a lot for the fast replying. Really appreciate it.