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
docs(docs-infra): changed default type to object (angular#58289)
By API returned type is object, not any, rephrase docs and TIP
Fixesangular#58273
docs: change type from object to Object
Change the typo from object to Object
Co-authored-by: Matthieu Riegler <[email protected]>
PR Closeangular#58289
Note the generic type argument which specifies that the data returned by the server will be of type `Config`. This argument is optional, and if you omit it then the returned data will have type `any`.
21
+
Note the generic type argument which specifies that the data returned by the server will be of type `Config`. This argument is optional, and if you omit it then the returned data will have type `Object`.
22
22
23
-
Tip: If the data has an unknown shape, then a safer alternative to `any` is to use the `unknown` type as the response type.
23
+
Tip: When dealing with data of uncertain structure and potential `undefined` or `null` values, consider using the `unknown` type instead of `Object` as the response type.
24
24
25
25
CRITICAL: The generic type of request methods is a type **assertion** about the data returned by the server. `HttpClient` does not verify that the actual return data matches this type.
0 commit comments