diff --git a/packages/compiler-cli/test/compliance/r3_compiler_compliance_spec.ts b/packages/compiler-cli/test/compliance/r3_compiler_compliance_spec.ts index e2fa072fdb..c3b59e9a3d 100644 --- a/packages/compiler-cli/test/compliance/r3_compiler_compliance_spec.ts +++ b/packages/compiler-cli/test/compliance/r3_compiler_compliance_spec.ts @@ -1026,7 +1026,7 @@ describe('compiler compliance', () => { selector: 'complex', template: \`
-
\` +
\` }) export class ComplexComponent { } @@ -1104,7 +1104,7 @@ describe('compiler compliance', () => { @Component({ template: \`
- +
No ng-content, no instructions generated. diff --git a/packages/compiler/src/render3/view/template.ts b/packages/compiler/src/render3/view/template.ts index 53eabae505..69f2e89dff 100644 --- a/packages/compiler/src/render3/view/template.ts +++ b/packages/compiler/src/render3/view/template.ts @@ -59,7 +59,11 @@ export function renderFlagCheckIfStmt( } // Default selector used by `` if none specified -const DEFAULT_CONTENT_SELECTOR = '*'; +const DEFAULT_NG_CONTENT_SELECTOR = '*'; + +// Selector attribute name of `` +const NG_CONTENT_SELECT_ATTR = 'select'; + export class TemplateDefinitionBuilder implements t.Visitor, LocalResolver { private _dataIndex = 0; private _bindingContext = 0; @@ -411,7 +415,7 @@ export class TemplateDefinitionBuilder implements t.Visitor, LocalResolver visitContent(ngContent: t.Content) { this._hasNgContent = true; const slot = this.allocateDataSlot(); - let selectorIndex = ngContent.selector === DEFAULT_CONTENT_SELECTOR ? + let selectorIndex = ngContent.selector === DEFAULT_NG_CONTENT_SELECTOR ? 0 : this._ngContentSelectors.push(ngContent.selector); const parameters: o.Expression[] = [o.literal(slot)]; @@ -419,9 +423,9 @@ export class TemplateDefinitionBuilder implements t.Visitor, LocalResolver const attributeAsList: string[] = []; ngContent.attributes.forEach((attribute) => { - const name = attribute.name; - if (name !== 'select') { - attributeAsList.push(name, attribute.value); + const {name, value} = attribute; + if (name.toLowerCase() !== NG_CONTENT_SELECT_ATTR) { + attributeAsList.push(name, value); } }); diff --git a/packages/core/test/linker/projection_integration_spec.ts b/packages/core/test/linker/projection_integration_spec.ts index be24f38070..534c24e5d7 100644 --- a/packages/core/test/linker/projection_integration_spec.ts +++ b/packages/core/test/linker/projection_integration_spec.ts @@ -81,22 +81,21 @@ describe('projection', () => { expect(main.nativeElement).toHaveText(''); }); - fixmeIvy('FW-789: select attribute on should not be case-sensitive') - .it('should support multiple content tags', () => { - TestBed.configureTestingModule({declarations: [MultipleContentTagsComponent]}); - TestBed.overrideComponent(MainComp, { - set: { - template: '' + - '
B
' + - '
C
' + - '
A
' + - '
' - } - }); - const main = TestBed.createComponent(MainComp); + fixmeIvy('unknown').it('should support multiple content tags', () => { + TestBed.configureTestingModule({declarations: [MultipleContentTagsComponent]}); + TestBed.overrideComponent(MainComp, { + set: { + template: '' + + '
B
' + + '
C
' + + '
A
' + + '
' + } + }); + const main = TestBed.createComponent(MainComp); - expect(main.nativeElement).toHaveText('(A, BC)'); - }); + expect(main.nativeElement).toHaveText('(A, BC)'); + }); it('should redistribute only direct children', () => { TestBed.configureTestingModule({declarations: [MultipleContentTagsComponent]});