You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
And it needs to be used with all the bindings set like this <simple-button enabled="true" name="Foo" onClick="foo()"></simple-button>. A programmer shouldn't be able to use it without one or more non-optional attribute like this <simple-button></simple-button> or <simple-button enabled="true" name="Foo"></simple-button>.
There's no way to ensure that all required bindings will be set. This causes unpredictable behavior and it's a bit hard to debug if any of them is forgotten.
There's no way to enforce that a binding in the component is required and must be set as an attribute.
If a binding is non-optional (without ?) and no value is given it's set to undefined.
At the moment <simple-button enabled="undefined"></simple-button> and <simple-button></simple-button> are indistinguishable from each other (when non-optional).
Expected / new behavior:
It throws an error if required binding is not set as an attribute of a component.
Angular version:
latest
Anything else:
I see two possible ways to solve this.
The first is to enforce all bindings without ? to be set as an attribute of a component. But I can see that may be a bit too radical. I tried and it worked but broke 105 tests :/
The second is to introduce a new marker that will indicate that attribute must be set. ! looks like a good candidate.
I'm willing to submit a PR if there's a decision how to proceed :)