Skip to content

Commit

Permalink
feat(DomElementSchemaRegistry): add support for <ng-content> and <ng-…
Browse files Browse the repository at this point in the history
…container>
  • Loading branch information
vicb committed Jun 16, 2016
1 parent e484c62 commit b620f4f
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
Expand Up @@ -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 {
Expand Down
Expand Up @@ -72,6 +72,16 @@ export function main() {
expect(registry.securityContext('p', 'formAction')).toBe(SecurityContext.URL);
});

describe('Angular custom elements', () => {
it('should support <ng-container>',
() => { expect(registry.hasProperty('ng-container', 'id')).toBeFalsy(); });

it('should support <ng-content>', () => {
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';
Expand Down

0 comments on commit b620f4f

Please sign in to comment.