fix(compiler): use the other case by default in ICU messages
This commit is contained in:
@ -106,6 +106,13 @@ function _expandDefaultForm(ast: html.Expansion, errors: ParseError[]): html.Ele
|
||||
const expansionResult = expandNodes(c.expression);
|
||||
errors.push(...expansionResult.errors);
|
||||
|
||||
if (c.value === 'other') {
|
||||
// other is the default case when no values match
|
||||
return new html.Element(
|
||||
`template`, [new html.Attribute('ngSwitchDefault', '', c.valueSourceSpan)],
|
||||
expansionResult.nodes, c.sourceSpan, c.sourceSpan, c.sourceSpan);
|
||||
}
|
||||
|
||||
return new html.Element(
|
||||
`template`, [new html.Attribute('ngSwitchCase', `${c.value}`, c.valueSourceSpan)],
|
||||
expansionResult.nodes, c.sourceSpan, c.sourceSpan, c.sourceSpan);
|
||||
|
Reference in New Issue
Block a user