angular / angular/components

Documentation does not explain what generics represent

Open Beginner friendly
#22,121 5 comments 0 reactions 0 assignees View on GitHub
area: dev-infra docs P2
Dominant language
TypeScript
Stars
25k
Forks
6.8k
Avg merge
1d 8h
Merged PRs (30d)
91

Description

#### Documentation Feedback

In docs it would be helpful to have documentaion for declared TS generics.
For example, I open `MatDatepickerInputEvent` [docs](https://material.angular.io/components/datepicker/api#MatDatepickerInputEvent) and see `S` and `D` generics.
And from the docs it's unclear what these `S` and `D` represent!

I think it should be documented similar to as Java does it.
For example, a [docs](https://docs.oracle.com/en/java/javase/15/docs/api/java.base/java/util/function/Function.html) of Java's standard type `Function` contain a section

> Type Parameters:
> T - the type of the input to the function
> R - the type of the result of the function

Contributor guide

Open the contributing guide

Research direction

Start with the MatDatepickerInputEvent entry in the Angular Material datepicker API documentation and inspect how its TypeScript declaration is presented. Document what the S and D type parameters represent, following the type-parameter style shown in the linked Java documentation. Done means newcomers can understand both generics from the API docs.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
documentation
Issue type
Documentation
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.