Do all the things like ++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatarSign Up
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple APILearn More
“Hmm... I don’t know which type this will be..., Eck, will do later”
ostream37122yWhy isn't that explained in the doc then? Am I supposed to guess it? -_-
I agree with both of you. HTML is cause of it. There are more attributes like that (selected for example). When a framework takes over and generates the HTML it should elaborate on what it wants. Just a mention or reference to the html docs should be enough.
Most CMS's also have a checkbox "checked" to specify the default value. That is a boolean too. The framework could do the same and implement it as boolean and translate it to present and not present.
I can appreciate an attempt at mediation, but that is the rub: it's not a boolean. It's a stream, and is only looking for not null | undefined | false. It can be a boolean, number, string, Array, Object, evaluated expressions, et al. It is truly any. Typescript doesn't currently have a way to define a negative disjunction type.
The documentation supplies exhaustive examples of both usage and composition, it's not just a jsdoc dump:
Here's a stackblitz demonstrating the principle:
hjk10150352y@SortOfTested I did not attempt to meditate. I see your point in what it is in html but it's not html but JS.
They could have implemented it as disabled=false (default) results in absent. disabled=true results in disabled="disabled" html in other words present.
I don't know what is wise as I'm not versed in angular at all. If the documentation states it follows html in its attributes the OP should have looked better.