diff --git a/modules/@angular/compiler/src/schema/dom_element_schema_registry.ts b/modules/@angular/compiler/src/schema/dom_element_schema_registry.ts index 5c8fdb6913..c9e2b650cc 100644 --- a/modules/@angular/compiler/src/schema/dom_element_schema_registry.ts +++ b/modules/@angular/compiler/src/schema/dom_element_schema_registry.ts @@ -265,7 +265,11 @@ export class DomElementSchemaRegistry extends ElementSchemaRegistry { hasProperty(tagName: string, propName: string): boolean { if (tagName.indexOf('-') !== -1) { - // can't tell now as we don't know which properties a custom element will get + if (tagName === 'ng-container' || tagName === 'ng-content') { + return false; + } + + // Can't tell now as we don't know which properties a custom element will get // once it is instantiated return true; } else { diff --git a/modules/@angular/compiler/test/schema/dom_element_schema_registry_spec.ts b/modules/@angular/compiler/test/schema/dom_element_schema_registry_spec.ts index c03f2a8ca5..80692a80c9 100644 --- a/modules/@angular/compiler/test/schema/dom_element_schema_registry_spec.ts +++ b/modules/@angular/compiler/test/schema/dom_element_schema_registry_spec.ts @@ -72,6 +72,16 @@ export function main() { expect(registry.securityContext('p', 'formAction')).toBe(SecurityContext.URL); }); + describe('Angular custom elements', () => { + it('should support ', + () => { expect(registry.hasProperty('ng-container', 'id')).toBeFalsy(); }); + + it('should support ', () => { + expect(registry.hasProperty('ng-content', 'id')).toBeFalsy(); + expect(registry.hasProperty('ng-content', 'select')).toBeFalsy(); + }); + }); + if (browserDetection.isChromeDesktop) { it('generate a new schema', () => { let schema = '\n';