From b620f4f456f58ed7e00fec45844cfb28ef509020 Mon Sep 17 00:00:00 2001 From: Victor Berchet Date: Wed, 15 Jun 2016 09:57:58 -0700 Subject: [PATCH] feat(DomElementSchemaRegistry): add support for and --- .../compiler/src/schema/dom_element_schema_registry.ts | 6 +++++- .../test/schema/dom_element_schema_registry_spec.ts | 10 ++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) 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';