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

What about throwing error when inputs are defined #6

Open
EmmanuelDemey opened this issue Jan 28, 2023 · 2 comments
Open

What about throwing error when inputs are defined #6

EmmanuelDemey opened this issue Jan 28, 2023 · 2 comments
Labels
enhancement New feature or request

Comments

@EmmanuelDemey
Copy link
Contributor

I would like your opinion about something we can add to our components in order to improve Developer Experience.

For example for the component https://github.com/CreamLib/ngx-cream-lib/blob/main/projects/ngx-cream-lib/src/lib/collapsible/collapsible.component.ts we have the summary input, that is mandatory I think.

In the TypeScript file, we can throw a TypeScript error if this input is not defined (undefined or empty string), in order to have the information directly on the Browser DevTools console.

What do you think ?

@gericci
Copy link
Contributor

gericci commented Jan 29, 2023

Nice idea! There are indeed some components with mandatory properties; how do you see it? a simple console.log?

@EmmanuelDemey
Copy link
Contributor Author

I will throw a runtime exception. Something like explained here
https://stackoverflow.com/questions/35528395/make-directive-input-required

@gericci gericci added the enhancement New feature or request label Jan 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants