Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

no-access-missing-member: bug when using a method on an object? #97

Closed
cexbrayat opened this issue Sep 25, 2016 · 2 comments
Closed

no-access-missing-member: bug when using a method on an object? #97

cexbrayat opened this issue Sep 25, 2016 · 2 comments
Assignees
Labels

Comments

@cexbrayat
Copy link
Contributor

When linting this component with codelyzer beta.0 and no-access-missing-member: true:

@Component({
  selector: 'ns-pony',
  template: `<img [src]="'/images/pony-' + pony.color.toLowerCase() + '.png'">`
})
export class PonyComponent {
  @Input() pony: PonyModel;
}

and PonyModel is:

interface PonyModel {
  name: string;
  color: string;
}

I'm running into the linting error:
(no-access-missing-member) tests/pony.ts[9, 44]: The method "pony" that you're trying to access does not exist in the class declaration.

whereas we should have no error (the pony field has indeed a color attribute of type string).

@aitboudad
Copy link

Hi, I get the same issue when the property is defined in the parent class

export class TestComponent extends BaseComponent {
}

@mgechev
Copy link
Owner

mgechev commented Sep 27, 2016

@cexbrayat thanks for pointing this out. This one will be easy to fix. @aitboudad yeah, this is in the roadmap. We will need to use the TypeScript language service in order to resolve the symbol location in such locations.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants