Pregunta

I try to write a While loop in Rythm within HTML tags but I can't

something like this code:

@{
int i = 0;
while( i< 5){
i++;
}

<h2>hello</h2>

@{
}
}
¿Fue útil?

Solución

At the moment Rythm does not support while loop. Use for loop instead for your case:

@for(int i = 0; i < 5; ++i) {
    <h2>hello</h2>
}
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top