1

How to add multi line comments in knockout js in magento Such as we have add single line and multi lines comments on other languages.

Amit
  • 31
  • 2

1 Answers1

0

There is no such thing as a multi-line comment in Knockout JS, you are supposed to comment the code line by line.

You can use the following syntax:

<!-- kocomment foreach: { data: $record().elems(), as: 'elem'}  -->
//Other code
<!-- /kocomment --> 

This effectively turns ko statements into a simple html comment (knockout does not care for such comments).

Just make sure to comment out both opening and closing statement

Wolfack
  • 2,667
  • 1
  • 26
  • 50