ngneat / dialog

👻 A simple to use, highly customizable, and powerful modal for Angular Applications
https://ngneat.github.io/dialog/
MIT License
394 stars 38 forks source link

Documentation does not (clearly) state that ref property should be public #98

Closed milo526 closed 1 year ago

milo526 commented 1 year ago

I'm submitting a...


[ ] Regression (a behavior that used to work and stopped working in a new release)
[ ] Bug report  
[ ] Performance issue
[ ] Feature request
[x] Documentation issue or request
[ ] Support request
[ ] Other... Please describe:

Current behavior

For type inference to work on the DialogService.open, DialogComponent.afterClosed$ and DialogComponent.close components, it is essential that the to-be-opened dialog component has a public property with a DialogRef<Input, Output> type. This is not made clear (enough) in the current documentation.

Many code-bases have rules that state that modifiers should be as strict as possible. If the DialogRef property is made private or protected the typing would fallback to any, missing the possible benefits of types.

Expected behavior

Documentation is clear of the fact that the ref property needs to be public.
Ideally this is added as a note in the readme.

Minimal reproduction of the problem with instructions

What is the motivation / use case for changing the behavior?

Documentation should be clear on how to use this library and use all of its features, including proper typing.

Environment


Angular version: X.Y.Z


Browser:
- [ ] Chrome (desktop) version XX
- [ ] Chrome (Android) version XX
- [ ] Chrome (iOS) version XX
- [ ] Firefox version XX
- [ ] Safari (desktop) version XX
- [ ] Safari (iOS) version XX
- [ ] IE version XX
- [ ] Edge version XX

For Tooling issues:
- Node version: XX  
- Platform:  

Others:

Just let me know if you are willing to accept a PR adding this note.

NetanelBasal commented 1 year ago

Sure