build(aio): rendering of optional parameters#22435
build(aio): rendering of optional parameters#22435petebacondarwin wants to merge 2 commits intoangular:masterfrom
Conversation
|
You can preview a96747a at https://pr22435-a96747a.ngbuilds.io/. |
|
You can preview d01479e at https://pr22435-d01479e.ngbuilds.io/. |
| <td class="param-description"> | ||
| {% if parameter.description | trim %}{$ parameter.description | marked $} | ||
| {% marked %} | ||
| {% if parameter.isOptional or parameter.defaultValue !== undefined %}Optional. Default is `{$ parameter.defaultValue === undefined and 'undefined' or parameter.defaultValue $}`.{% endif %} |
There was a problem hiding this comment.
I would consider placing this after the description/type.
There was a problem hiding this comment.
I was following the example given in @jbogarthyde's Google doc "Animations API example".
There was a problem hiding this comment.
We can change the ordering around later, as we get more eyes on this - especially when parameters actually start getting descriptions :-P . Meanwhile the question of whether/where to show the type of the param is more problematic IMO.
There was a problem hiding this comment.
Normally, I would suggest having the type in a separate column. But given the fact that some types will be too verbose and that the types are already shown in the signature, I think it is fine to just show the description.
|
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. |

Closes #22134
Now we automatically render
Optional.at the start of the parameter description if the parameter is not required. We also render the value given to the parameter if it is not provided in the call.An example is in the Location class... (https://pr22435-d01479e.ngbuilds.io/api/common/Location#path)
Note that if there is no description for the parameter then we currently just display the type of the parameter. This is up for negotiation.