Skip to content

Commit

Permalink
tests: add template comment examples
Browse files Browse the repository at this point in the history
  • Loading branch information
IgnaceMaes committed Aug 21, 2024
1 parent b4e6546 commit 4a8fc11
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion tests/data/glimmer-js.gjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// 26 lines, 18 code, 5 comments, 4 blanks
// 28 lines, 18 code, 7 comments, 4 blanks
import { helper } from '@ember/component/helper';
import { modifier } from 'ember-modifier';

Expand All @@ -13,6 +13,8 @@ const setScrollPosition = modifier((element, [position]) => {
});

<template>
<!-- A HTML-like comment -->
{{!-- But also glimmer handlebars-like comments are valid in the template --}}
<div class="scroll-container" {{setScrollPosition @scrollPos}}>
{{#each @items as |item index|}}
Item #{{plusOne index}}: {{item}}
Expand Down
4 changes: 3 additions & 1 deletion tests/data/glimmer-ts.gts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// 17 lines, 10 code, 5 comments, 3 blanks
// 19 lines, 10 code, 7 comments, 3 blanks
import type { TemplateOnlyComponent } from '@glimmer/component';

// A single-line comment
Expand All @@ -8,6 +8,8 @@ const localVariable = 'foo';
* A multi-line comment
*/
const Greet: TemplateOnlyComponent<{ name: string }> = <template>
<!-- A HTML-like comment -->
{{!-- But also glimmer handlebars-like comments are valid in the template --}}
<p>Hello, {{@name}}! {{localVariable}}</p>
<style>
p {
Expand Down

0 comments on commit 4a8fc11

Please sign in to comment.