fix(ivy): handle pipes in i18n attributes properly (#30573)
Prior to this change we processed binding expression (including bindings with pipes) in i18n attributes before we generate update instruction. As a result, slot offsets for pipeBind instructions were calculated incorrectly. Now we perform binding expression processing when we generate "update block" instructions, so offsets are calculated correctly. PR Close #30573
This commit is contained in:

committed by
Jason Aden

parent
70fd4300f4
commit
02523debe5
@ -570,6 +570,14 @@ onlyInIvy('Ivy i18n logic').describe('runtime i18n', () => {
|
||||
expect(fixture.nativeElement.innerHTML).toEqual(`<div title="bonjour John"></div>`);
|
||||
});
|
||||
|
||||
it('with pipes', () => {
|
||||
ɵi18nConfigureLocalize(
|
||||
{translations: {'hello {$interpolation}': 'bonjour {$interpolation}'}});
|
||||
const fixture = initWithTemplate(
|
||||
AppComp, `<div i18n i18n-title title="hello {{name | uppercase}}"></div>`);
|
||||
expect(fixture.nativeElement.innerHTML).toEqual(`<div title="bonjour ANGULAR"></div>`);
|
||||
});
|
||||
|
||||
it('multiple attributes', () => {
|
||||
ɵi18nConfigureLocalize(
|
||||
{translations: {'hello {$interpolation}': 'bonjour {$interpolation}'}});
|
||||
|
Reference in New Issue
Block a user