-
Notifications
You must be signed in to change notification settings - Fork 6.8k
docs(cdk/coercion): expand overview #22791
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good start to the doc! I wonder if we eventually want to add some kind of table that helps users know what different values turn into, e.g. `` turns to true
, `"false"` is `false`, etc
|
||
### Example | ||
|
||
```ts |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we make this a full example? It's pretty extensive for a code block
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My reasoning for keeping it inline is that the example won't be particularly visual since the coercion only affects the public API of the component.
Companion PR to angular/material.angular.io#994. Expands the overview of the coercion package so that we have more than one sentence to show.
// It also allows for a string to be passed like `<my-button disabled="true"></my-button>`. | ||
@Input() | ||
get disabled() { return this._disabled; } | ||
set disabled(value: any) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry to ask, but is any
correct here (and in the other example)? I ask therefore, because as it is a bad practice, IMHO it shouldn't be in official docs as this can influence bad habits for other devs. Note that a simple boolean
/number
would solve it (as you already does in majority of your components).
Companion PR to angular/material.angular.io#994. Expands the overview of the coercion package so that we have more than one sentence to show. (cherry picked from commit 0b04570)
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Companion PR to angular/material.angular.io#994. Expands the overview of the coercion package so that we have more than one sentence to show.