Frage

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>

@{
}
}
War es hilfreich?

Lösung

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>
}
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top