Switch and case constructs in Angular
Angular also provides @switch, @case, and @default constructs:
@switch (str) {
@case ('a') {
<div>
aaa
</div>
}
@case ('b') {
<div>
aaa
</div>
}
@case ('c') {
<div>
ccc
</div>
}
@default {
<div>
error
</div>
}
}
Let the property lang contain the name of the language: 'ru', 'en' or 'de'. Depending on the content, show the phrase in the given language or an error if there is no such language.