I have the following Angular2 TypeScript code with a section commented out as per Javascript convention:
@Component({
selector: 'my-app',
template:
`<h1>{{title}}</h1>
<h2>{{lene.name}}</h2>
<div><label>id: </label>{{lene.id}}</div>
/*<div>
<label>name: </label>
<input [(ngModel)]="lene.name" placeholder="name">
</div>*/`
<div><label>description: </label>{{lene.description}}</div>
})
However, once the TypeScript compiles to Javascript I get the following output to my web browser:
I've searched the API docs and can't find an entry specifying the syntax for this quite basic feature. Anyone know how you do multi-line comments in TypeScript?
\`` is a string. Within strings comments (actually almost everything except string interpolation) is ignored. When using HTML comment syntax the string is fowarded to the browser (including the ``) which then interprets this part of the string as comment.
– Günter Zöchbauer Apr 04 '16 at 07:48