KendoUI template is invalid

I'm creating a KendoUI template like this:

            <ul class="nav nav-list flow-list">
                <li class="nav-header">Flows in action</li>
                <script id="flow-list" type="text/x-kendo-template">
                    #for (var i = 0; i < data.length; i++ {#
                        <li>#=data[i]#</li>
                    #}#
                </script>
            </ul>

And here is how I'm passing data:

//Get the external template definition using a jQuery selector
var template = kendo.template($("#flow-list").html());

//Create some dummy data
var data = ["Todd", "Steve", "Burke"];

//Execute the template
template(data);

Running the above code shows me an error saying "Invalid template"

Any pointers?

Upvotes: 1

Views: 1189

Answers (1)

Atanas Korchev
Atanas Korchev

Reputation: 30661

You are missing the closing parenthesis of the for loop.

#for (var i = 0; i < data.length; i++ /* missing ) */ {#

Here is a working demo: http://jsbin.com/ihivez/1/edit

Upvotes: 4

Related Questions