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.
Asked
Active
Viewed 321 times
1
-
1welcome to SO! please read [how to ask question?](https://stackoverflow.com/help/mcve) – Dev Jan 19 '19 at 17:01
-
`/* This doesn't work?*/` – adiga Jan 20 '19 at 07:22
1 Answers
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
-
Your welcome, please accept the answer in case it solved your problem. – Wolfack Jan 23 '19 at 12:15