fix(ivy): only remove missing placeholders with runtime i18n (#29252)
Dynamic nodes are created at the end of the view stack, but we were removing all the placeholders between `i18nStart` and the last created node index, instead of removing everything between `i18nStart` and `i18nEnd`. This caused errors when dynamic nodes where created in multiple i18n blocks because we would remove all of the dynamic nodes created in the previous i18n blocks. PR Close #29252
This commit is contained in:

committed by
Kara Erickson

parent
e6117a3a49
commit
7315a68ac6
@ -610,4 +610,15 @@ onlyInIvy('Ivy i18n logic').describe('i18n', function() {
|
||||
.toEqual(`<div-query><!--ng-container-->Contenu<!--container--></div-query>`);
|
||||
});
|
||||
});
|
||||
|
||||
it('should handle multiple i18n sections', () => {
|
||||
const template = `
|
||||
<div i18n>Section 1</div>
|
||||
<div i18n>Section 2</div>
|
||||
<div i18n>Section 3</div>
|
||||
`;
|
||||
const fixture = getFixtureWithOverrides({template});
|
||||
expect(fixture.nativeElement.innerHTML)
|
||||
.toBe('<div>Section 1</div><div>Section 2</div><div>Section 3</div>');
|
||||
});
|
||||
});
|
||||
|
Reference in New Issue
Block a user