LeO
LeO

Reputation: 5238

Angular 19: HTML template - recursion not working

Up to Angular 18 we have used something like this:

@Component({
    selector: 'app-role-card-main',
    templateUrl: './role-card-main.component.html',
})

and in the HMTL template

usedConfig: {{config|json}}
... 
@for (kiddie of kids; track kiddie.data.id) {
    ~~{{kiddie|json}}**
    <app-role-card-main [config]="kiddie"/>
}

which did a proper recursive call and displayed as well the sub components.

With the upgrade to 19.1 I see as result that the HTML renders properly

~~{{kiddie|json}}**

for the kid, i.e. there is some config data and it enters the loop. But for the recursive call no data is displayed for

usedConfig: {{config|json}}

although its the very first line in the HTML template.

Note: We didn't migrate the component to a standalone one. Since it worked in 18 I don't see a problem.

Upvotes: 1

Views: 52

Answers (0)

Related Questions