@if (item.children && item.children.length > 0) {
@for (subItem of item.children; track subItem) { }
} @if (!item.children || item.children.length === 0) {
}