fix(ivy): don't throw in i18nAttributes
when a component is re-rendered (#27911)
`i18nAttributes` was throwing an error when it was called multiple times in the create part of the template function with the same index, for example when we create multiple components with the same template. It shouldn't throw in this case, and just use the cache when available. FW-903 #resolve PR Close #27911
This commit is contained in:

committed by
Kara Erickson

parent
7db05c408c
commit
e6ab55daa0
@ -834,9 +834,6 @@ export function i18n(index: number, message: string, subTemplateIndex?: number):
|
||||
export function i18nAttributes(index: number, values: string[]): void {
|
||||
const tView = getLView()[TVIEW];
|
||||
ngDevMode && assertDefined(tView, `tView should be defined`);
|
||||
ngDevMode &&
|
||||
assertEqual(
|
||||
tView.firstTemplatePass, true, `You should only call i18nEnd on first template pass`);
|
||||
if (tView.firstTemplatePass && tView.data[index + HEADER_OFFSET] === null) {
|
||||
i18nAttributesFirstPass(tView, index, values);
|
||||
}
|
||||
|
Reference in New Issue
Block a user