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

2 posts, 0 answers
  1. Richardsonke
    Richardsonke avatar
    93 posts
    Member since:
    Jul 2007

    Posted 07 Feb 2013 Link to this post

    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 {#
                    #= Field2 #<br />
                    #if(Field1 !== null) {#

    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:

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

    I don't think this was happening before 1.2.

    Feedback item:

  2. Stefan Dobrev
    Stefan Dobrev avatar
    790 posts

    Posted 08 Feb 2013 Link to this post

    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.
Back to Top