This is a migrated thread and some comments may be shown as answers.

Conditional Statements in Kendo Templates Confuse Code Analysis and Auto-Text

1 Answer 54 Views
Report a bug
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Richardsonke
Top achievements
Rank 1
Richardsonke asked on 07 Feb 2013, 02:53 PM
Thanks for all the new features and bug fixes in 1.2!  I found one problem though.

Some conditional statements in Kendo UI templates can cause Icenium to have problems with code analysis.  For example:

<script id="test-template" type="text/x-kendo-template">
                <p>Test:<br />
                #if(Field1 !== null) {#
                    <span class="Test">
                    <a href="javascript:test('#= Field1 #');">
                #} else {#
                    <span>
                #}#
                #= Field2 #<br />
                #if(Field1 !== null) {#
                    </a>
                #}#
                </span>
</script>

On the </a> line, Icenium shows an error of "HTML: Expected </span>".  This in itself is not a big problem, but if you have another script tag at the bottom of the page, any time you type a ">", it throws in a </script>.  For example:

<script>
            var app = new kendo.mobile.Application(document.body, { transition: "slide", layout: "mobile-tabstrip" });
            
            if(1 ></script>
</script>

I don't think this was happening before 1.2.

Feedback item: http://feedback.telerik.com/Project/87/Feedback/Details/40521-conditional-statements-in-kendo-templates-confuse-code-analysis-and-auto-text

1 Answer, 1 is accepted

Sort by
0
Stefan Dobrev
Telerik team
answered on 08 Feb 2013, 08:18 AM
Hi Keith,

Please find my answer on the feedback item you have submitted.

The reason why this was not happening prior 1.2 is that we were not supporting Kendo templates in the Code Analysis engine. In 1.2 Kendo templates are fully analyzed giving you syntax highlighting, code navigations, refactorings and all other code analysis goodies.

All the best,
Stefan Dobrev
the Telerik team

Share feedback and vote for features on our Feedback Portal.
Want some Kendo UI online training - head over to Pluralsight.
Tags
Report a bug
Asked by
Richardsonke
Top achievements
Rank 1
Answers by
Stefan Dobrev
Telerik team
Share this question
or