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

Types of accessors are not resolved propery #246

Closed
devversion opened this issue Oct 4, 2017 · 5 comments
Closed

Types of accessors are not resolved propery #246

devversion opened this issue Oct 4, 2017 · 5 comments

Comments

@devversion
Copy link
Member

devversion commented Oct 4, 2017

Hey there,

With the recent changes to more object orientated documents, the types for accessors are no longer resolved properly.

class MdButton {

  get checked(): boolean { return this._checked;  }
  set checked(value) {
    this._checked = value;
  }
}

Also those getters and setters are being treated as functions, while they theoretically can be considered as properties of the class.

This means that right now we need to manually determine the types of the accessors in our Dgeni package.

The issue here is, that the members of the class may exist twice and the type of the "property" can be defined in two different places. Either in the getter or in the setter as a first parameter.

@petebacondarwin
Copy link
Member

Can you not use the isGetAccessor and isSetAccessor on the docs? See https://github.com/angular/dgeni-packages/blob/master/typescript/src/api-doc-types/MemberDoc.ts

@devversion
Copy link
Member Author

Good point, I saw those two properties on the MemberDoc class. The problem I had, was that I only got one document for the getter and setter.

This document then just had both isGetAccessor and isSetAccessor set to true, and didn't have a type specified either.

@petebacondarwin
Copy link
Member

Good spot, it is a bit buggy. Let me come up with a fix.

@petebacondarwin
Copy link
Member

I have created a PR which should solve this problem... #247

@devversion
Copy link
Member Author

@petebacondarwin Thanks! I will try to give it a shot this today/tomorrow. Will keep you updated.

petebacondarwin added a commit to petebacondarwin/dgeni-packages that referenced this issue Oct 8, 2017
devversion added a commit to devversion/material2 that referenced this issue Oct 9, 2017
Due to angular/dgeni-packages#246 the Material docs package used a workaround for accessor types.

The issue has been fixed with angular/dgeni-packages#247 and the workaround can be removed now.
devversion added a commit to devversion/material2 that referenced this issue Oct 9, 2017
Due to angular/dgeni-packages#246 the Material docs package used a workaround for accessor types.

The issue has been fixed with angular/dgeni-packages#247 and the workaround can be removed now.
andrewseguin pushed a commit to angular/components that referenced this issue Oct 12, 2017
Due to angular/dgeni-packages#246 the Material docs package used a workaround for accessor types.

The issue has been fixed with angular/dgeni-packages#247 and the workaround can be removed now.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants