-
-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: 🎸 Add support for self closing tag and control flow (#180)
- Loading branch information
Showing
10 changed files
with
226 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
<span>{{ '1' | transloco }}</span> | ||
<span transloco="2"></span> | ||
<ng-container *transloco="let t"> | ||
<span>{{ t('3') }}</span> | ||
</ng-container> | ||
<ng-template transloco let-t> | ||
<span>{{ t('4') }}</span> | ||
</ng-template> | ||
|
||
|
||
@if (a > b) { | ||
<span>{{ '5' | transloco }}</span> | ||
<span transloco="6"> | ||
</span> | ||
<ng-container *transloco="let t"> | ||
<span>{{ t('7') }}</span> | ||
</ng-container> | ||
<ng-template transloco let-t> | ||
<span>{{ t('8') }}</span> | ||
</ng-template> | ||
} @else if (b > a) { | ||
<span>{{ '9' | transloco }}</span> | ||
} @else { | ||
<span [innerHtml]="'10' | transloco"></span> | ||
} | ||
|
||
@for (item of items; track item.id) { | ||
{{ '11' | transloco }} | ||
} @empty { | ||
<span>{{ '12' | transloco }}</span> | ||
} | ||
|
||
@switch (condition) { | ||
@case (caseA) { | ||
<span>{{ '13' | transloco }}</span> | ||
} | ||
@default { | ||
<span>{{ '14' | transloco }}</span> | ||
} | ||
} | ||
|
||
@defer { | ||
<span>{{ '15' | transloco }}</span> | ||
} @error { | ||
<span>{{ '16' | transloco }}</span> | ||
} @placeholder { | ||
<span>{{ '17' | transloco }}</span> | ||
} @loading { | ||
<span>{{ '18' | transloco }}</span> | ||
} | ||
|
||
<ng-container *transloco="let t"> | ||
@if (a > b) { | ||
<span>{{ t('19') }}</span> | ||
} @else if (b > a) { | ||
<span [innerHtml]="t('20')"></span> | ||
} @else { | ||
@for (item of items; track item.id) { | ||
<span>{{ t('21') }}</span> | ||
} @empty { | ||
@switch (condition) { | ||
@case (caseA) { | ||
<span>{{ t('22') }}</span> | ||
} | ||
@default { | ||
@defer { | ||
<span>{{ '23' | transloco }}</span> | ||
} @error { | ||
<span transloco="24"></span> | ||
} @placeholder { | ||
<span>{{ t('25') }}</span> | ||
} @loading { | ||
<span>{{ t('26') }}</span> | ||
} | ||
} | ||
} | ||
} | ||
} | ||
</ng-container> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters