-
Notifications
You must be signed in to change notification settings - Fork 815
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
Refactor suggestions about @Input and implementing a custom decorator #767
Comments
It was mentioned in #863 (comment) that a reason for not doing this is being unable to generate docs. There doesn't seem to be a proper document generation tool for Angular (yet). However, |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
The code is currently using
inputs
array of strings on component metadata to tell Angular that properties with these names are to be considered inputs. This way of listing such properties is currently considered bad practice according to official Angular styleguide. It makes sense: maintaining is difficult because it's scattered around, and let's not even begin on typos and refactoring.So my first suggestion is moving away from
inputs
and using@Input()
instead.In a similar fashion, we're maintaining an array of strings
_mapOptionsAttributes
in order to iterate over them more easily. This can be solved with a custom decorator; here's a proposed simple implementation.And example usage:
The accompanying JS bin in action is also available.
How does it seem? Any suggestions? @SebastianM, if you like the idea, I could work out a PR.
The text was updated successfully, but these errors were encountered: