Is there any to comment out a knock out code in HTML, since the ko code is already in default html comment block.
<!-- ko if : isEditable() -->
<!-- Edit Mode -->
<div class="edit">Edit mode</div>
<!-- /ko -->
Can I comment the above section in my html
In our project we tend to use <!-- kocomment if : isEditable() --><!-- /kocomment -->
syntax which effectively turns ko statement
into a simple html comment (knockout does not care for such comments).
Or you may use shorter additions to ko
word. Just make sure to comment out both opening and closing statement, there is also risk that this commented comment will not stand out, unless you have some knockout syntax highlighting.
Just change the ko to anything else!
<!-- koc if : isEditable() --> or <!-- kcomment if : isEditable() -->
anything other that ko makes it as a comment.
As knockout looks only for html comments that start with ko, anything other than ko on an html comment will simply be a comment.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With