jehugaleahsa / mustache-sharp

An extension of the mustache text template engine for .NET.
The Unlicense
306 stars 78 forks source link

Recursivity with partials not working #48

Closed slashafk closed 9 years ago

slashafk commented 9 years ago

I have a JSON element with some recursivity in it :

[
    {
        "Nom": "Accueil",
        "CleMenu": 97038,
        "Menus": []
    },
    {
        "Nom": "Conseil",
        "CleMenu": 96442,
        "Menus": [
            {
                "Nom": "Gérer au quotidien",
                "CleMenu": 96443,
                "Menus": []
            }
        ]
    }
]

And according to Mustache documentation, using partials like this :

{{<menu}}
<li class="">
    <a href="">{{Nom}}</a>
    {{if Menu.Menus}}
        <ul>
            {{>menu}}
        </ul>
    }}
</li>
{{/menu}}

<ul>
    {{#each Menu}}
        {{>menu}}        
    {{/each}}
</ul>

I should be able to iterate over my elements recursively ... but it seems that the element is simply ignored by your library. Is it supported or not ? (I've not been able to find the partials in your documentation :s).

jehugaleahsa commented 9 years ago

I had never even heard of this feature. Pretty sweet.