|
| 1 | +<!-- SYNTAX TEST "NgxHTML.sublime-syntax" --> |
| 2 | + |
| 3 | +@if (loggedIn) { |
| 4 | +<!-- <- punctuation.definition.keyword.html --> |
| 5 | + <!-- <- keyword.control.control-flow.html --> |
| 6 | + <!-- <- keyword.control.control-flow.html --> |
| 7 | + <!-- ^ punctuation.section.block.begin.html --> |
| 8 | + The user is logged in |
| 9 | +} @else { |
| 10 | +<!-- <- punctuation.section.block.end.html --> |
| 11 | + <!-- ^ punctuation.section.block.begin.html --> |
| 12 | + <!-- <- punctuation.definition.keyword.html --> |
| 13 | + <!-- <- keyword.control.control-flow.html --> |
| 14 | + <!-- <- keyword.control.control-flow.html --> |
| 15 | + <!-- <- keyword.control.control-flow.html --> |
| 16 | + <!-- <- keyword.control.control-flow.html --> |
| 17 | + The user is not logged in |
| 18 | +} |
| 19 | +<!-- <- punctuation.section.block.end.html --> |
| 20 | + |
| 21 | +@if (a > b) { |
| 22 | + {{ a }} is greater than {{ b }} |
| 23 | + <!-- <- punctuation.section.interpolation.begin.ngx.html --> |
| 24 | + <!-- <- punctuation.section.interpolation.begin.ngx.html --> |
| 25 | + <!-- <- punctuation.section.interpolation.end.ngx.html --> |
| 26 | + <!-- <- punctuation.section.interpolation.end.ngx.html --> |
| 27 | +} |
| 28 | + |
| 29 | +@if (a > b) { |
| 30 | + {{ a }} is greater than {{ b }} |
| 31 | +} @else if (b > a) { |
| 32 | + {{ a }} is less than {{ b }} |
| 33 | +} @else { |
| 34 | + {{ a }} is equal to {{ b }} |
| 35 | +} |
| 36 | + |
| 37 | +@switch (accessLevel) { |
| 38 | + @case ('admin') { |
| 39 | + <admin-dashboard /> |
| 40 | +<!-- ^^^^^^^^^^^^^^^ entity.name.tag.other.html --> |
| 41 | + <!-- <- punctuation.definition.tag.begin.html --> |
| 42 | + <!-- <- punctuation.definition.tag.end.html --> |
| 43 | + <!-- <- punctuation.definition.tag.end.html --> |
| 44 | + } |
| 45 | + @case ('moderator') { |
| 46 | + <moderator-dashboard /> |
| 47 | + } |
| 48 | + @default { |
| 49 | + <user-dashboard /> |
| 50 | + } |
| 51 | +} |
| 52 | + |
| 53 | +@for (user of users; track user.id) { |
| 54 | + {{ user.name }} |
| 55 | +} @empty { |
| 56 | + Empty list of users |
| 57 | +} |
| 58 | + |
| 59 | +@defer { |
| 60 | + <comment-list /> |
| 61 | +} |
| 62 | + |
| 63 | +@defer (on viewport) { |
| 64 | + <comment-list /> |
| 65 | +} @placeholder { |
| 66 | + <!-- A placeholder content to show until the comments load --> |
| 67 | + <img src="comments-placeholder.png" /> |
| 68 | +} |
| 69 | + |
| 70 | +@defer (on viewport) { |
| 71 | + <comment-list /> |
| 72 | +} @loading { |
| 73 | + Loading… |
| 74 | +} @error { |
| 75 | + Loading failed :( |
| 76 | +} @placeholder { |
| 77 | + <img src="comments-placeholder.png" /> |
| 78 | +} |
| 79 | + |
| 80 | +@defer (on viewport; prefetch on idle) { |
| 81 | + <comment-list /> |
| 82 | +} |
| 83 | + |
| 84 | +@for (item of items; track item.id; let idx = $index, e = $even) { |
| 85 | + Item #{{ idx }}: {{ item.name }} |
| 86 | +} |
| 87 | + |
| 88 | +@for (item of items) { |
| 89 | + <a [href]="item.link">{{ item.title }}</a> |
| 90 | +} |
| 91 | + |
| 92 | +@for (item of items) { |
| 93 | + <a [href]="item.link">{{ item.title }}</a> |
| 94 | +} @empty { |
| 95 | + <p>No Items</p> |
| 96 | +} |
| 97 | + |
| 98 | +@for (item of items; track item.name) { |
| 99 | + <li>{{ item.name }}</li> |
| 100 | +} @empty { |
| 101 | + <li>There are no items.</li> |
| 102 | +} |
| 103 | + |
| 104 | +@if (users$ | async; as users) { |
| 105 | + {{ users.length }} |
| 106 | +} |
| 107 | + |
| 108 | +@for (item of items; track item.id) { |
| 109 | + {{ item.name }} |
| 110 | +} |
| 111 | + |
| 112 | +@switch (condition) { |
| 113 | + @case (caseA) { |
| 114 | + Case A. |
| 115 | + } |
| 116 | + @case (caseB) { |
| 117 | + Case B. |
| 118 | + } |
| 119 | + @default { |
| 120 | + Default case. |
| 121 | + } |
| 122 | +} |
| 123 | + |
| 124 | +@defer (on <trigger>; when <condition>; prefetch on <trigger>; prefetch when <condition>) { |
| 125 | + <!-- deferred template fragment --> |
| 126 | + <calendar-cmp /> |
| 127 | +} @placeholder (minimum? <duration>) { |
| 128 | + <!-- placeholder template fragment --> |
| 129 | + <p>Placeholder</p> |
| 130 | +} @loading (minimum? <duration>; after? <duration>) { |
| 131 | + <!-- loading template fragment --> |
| 132 | + <img alt="loading image" src="loading.gif" /> |
| 133 | +} @error { |
| 134 | + <!-- error template fragment --> |
| 135 | + <p>An loading error occured</p> |
| 136 | +} |
0 commit comments