diff --git a/src/angular/config.ts b/src/angular/config.ts index 234c0ec3c..006e434c8 100644 --- a/src/angular/config.ts +++ b/src/angular/config.ts @@ -58,7 +58,15 @@ export const Config: Config = { }, predefinedDirectives: [ - { selector: 'form', exportAs: 'ngForm' } + { selector: 'form', exportAs: 'ngForm' }, + { selector: '[routerLinkActive]', exportAs: 'routerLinkActive' }, + { selector: '[ngModel]:not([formControlName]):not([formControl])', exportAs: 'ngModel' }, + { selector: '[md-menu-item], [mat-menu-item]', exportAs: 'mdMenuItem' }, + { selector: 'md-menu, mat-menu', exportAs: 'mdMenu' }, + { selector: 'md-button-toggle-group:not([multiple])', exportAs: 'mdButtonToggleGroup' }, + { selector: '[md-menu-trigger-for], [mat-menu-trigger-for], [mdMenuTriggerFor]', exportAs: 'mdMenuTrigger' }, + { selector: '[md-tooltip], [mat-tooltip], [mdTooltip]', exportAs: 'mdTooltip' }, + { selector: 'md-select, mat-select', exportAs: 'mdSelect' } ], logLevel: BUILD_TYPE === 'dev' ? LogLevel.Debug : LogLevel.None diff --git a/test/noAccessMissingMemberRule.spec.ts b/test/noAccessMissingMemberRule.spec.ts index ba01c65cf..9c4bde3d1 100644 --- a/test/noAccessMissingMemberRule.spec.ts +++ b/test/noAccessMissingMemberRule.spec.ts @@ -302,6 +302,93 @@ describe('no-access-missing-member', () => { assertSuccess('no-access-missing-member', source); }); + it('should not throw when routerLinkActive template ref is used in component', () => { + let source = ` + @Component({ + selector: 'foobar', + template: '{{ test }}' + }) + class Test {}`; + assertSuccess('no-access-missing-member', source); + }); + + + it('should not throw when ngModel template ref is used in component', () => { + let source = ` + @Component({ + selector: 'foobar', + template: '{{ test }}' + }) + class Test { + foo: string; + }`; + assertSuccess('no-access-missing-member', source); + }); + + it('should not throw when [md-menu-item] template ref is used in component', () => { + let source = ` + @Component({ + selector: 'foobar', + template: '
{{ test }}
' + }) + class Test { + foo: string; + }`; + assertSuccess('no-access-missing-member', source); + }); + + it('should not throw when md-menu template ref is used in component', () => { + let source = ` + @Component({ + selector: 'foobar', + template: '{{ test }}' + }) + class Test { + foo: string; + }`; + assertSuccess('no-access-missing-member', source); + }); + + it('should not throw when md-button-toggle-group template ref is used in component', () => { + let source = ` + @Component({ + selector: 'foobar', + template: '{{ test }}' + }) + class Test {}`; + assertSuccess('no-access-missing-member', source); + }); + + it('should not throw when md-menu-trigger-for template ref is used in component', () => { + let source = ` + @Component({ + selector: 'foobar', + template: '
{{ test }}
' + }) + class Test {}`; + assertSuccess('no-access-missing-member', source); + }); + + it('should not throw when mdTooltip template ref is used in component', () => { + let source = ` + @Component({ + selector: 'foobar', + template: '
{{ test }}
' + }) + class Test {}`; + assertSuccess('no-access-missing-member', source); + }); + + it('should not throw when mdSelect template ref is used in component', () => { + let source = ` + @Component({ + selector: 'foobar', + template: '{{ test }}' + }) + class Test {}`; + assertSuccess('no-access-missing-member', source); + }); + it('should fail with missing ref', () => { let source = ` @Component({