fix(ivy): include ngProjectAs into attributes array (#32784)

Prior to this commit, the `ngProjectAs` attribute was only included with a special flag and in a parsed format. As a result, projected node was missing `ngProjectAs` attribute as well as other attributes added after `ngProjectAs` one. This is problematic since app code might rely on the presence of `ngProjectAs` attribute (for example in CSS). This commit fixes the problem by including `ngProjectAs` into attributes array as a regular attribute and also makes sure that the parsed version of the `ngProjectAs` attribute with a special marker is added after regular attributes (thus we set them correctly at runtime). This change also aligns View Engine and Ivy behavior.

PR Close #32784
This commit is contained in:
Andrew Kushnir
2019-09-19 17:22:06 -07:00
committed by atscott
parent 278d634723
commit 966c2a326a
3 changed files with 53 additions and 11 deletions

View File

@ -1376,7 +1376,7 @@ describe('compiler compliance', () => {
const SimpleComponentDefinition = `
const $_c0$ = [[["", "title", ""]]];
const $_c1$ = ["[title]"];
const $_c2$ = [5, ["", "title", ""]];
const $_c2$ = ["ngProjectAs", "[title]", 5, ["", "title", ""]];
MyApp.ngComponentDef = $r3$.ɵɵdefineComponent({
type: MyApp,
@ -1428,7 +1428,7 @@ describe('compiler compliance', () => {
const SimpleComponentDefinition = `
const $_c0$ = [[["", "title", ""]]];
const $_c1$ = ["[title]"];
const $_c2$ = [5, ["", "title", ""]];
const $_c2$ = ["ngProjectAs", "[title],[header]", 5, ["", "title", ""]];
MyApp.ngComponentDef = $r3$.ɵɵdefineComponent({
type: MyApp,