Skip to content

Commit

Permalink
fix: add spec for as syntax
Browse files Browse the repository at this point in the history
Fix #289
  • Loading branch information
mgechev committed Apr 22, 2017
1 parent 4fa35f6 commit a7500cb
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
1 change: 0 additions & 1 deletion src/noAccessMissingMemberRule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,6 @@ export class Rule extends Lint.Rules.AbstractRule {
typescriptOnly: true,
};


static FAILURE: string = 'The %s "%s" that you\'re trying to access does not exist in the class declaration.';

public apply(sourceFile:ts.SourceFile): Lint.RuleFailure[] {
Expand Down
13 changes: 13 additions & 0 deletions test/noAccessMissingMemberRule.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -562,6 +562,19 @@ describe('no-access-missing-member', () => {
assertSuccess('no-access-missing-member', source);
});

it('should work with "as" syntax', () => {
let source = `
@Component({
template: \`
<ng-container *ngIf="employee$ | async as emp">{{ emp }}</ng-container>
\`
})
class Test {
employee$;
}`;
assertSuccess('no-access-missing-member', source);
});


it('should work with local template variables', () => {
let source = `
Expand Down

0 comments on commit a7500cb

Please sign in to comment.