Pete Bacon Darwin
f2a1c66031
feat(ivy): ngcc - add typings to
ModuleWithProviders
functions (#27326)
Exported functions or static method that return a `ModuleWithProviders` compatible structure need to provide information about the referenced `NgModule` type in their return type. This allows ngtsc to be able to understand the type of `NgModule` that is being returned from calls to the function, without having to dig into the internals of the compiled library. There are two ways to provide this information: * Add a type parameter to the `ModuleWithProviders` return type. E.g. ``` static forRoot(): ModuleWithProviders<SomeNgModule>; ``` * Convert the return type to a union that includes a literal type. E.g. ``` static forRoot(): (SomeOtherType)&{ngModule:SomeNgModule}; ``` This commit updates the rendering of typings files to include this type information on all matching functions/methods. PR Close #27326
Angular
Angular is a development platform for building mobile and desktop web applications using Typescript/JavaScript and other languages.
Quickstart
Changelog
Learn about the latest improvements.
Want to help?
Want to file a bug, contribute some code, or improve documentation? Excellent! Read up on our guidelines for contributing and then check out one of our issues in the hotlist: community-help.
Description
Languages
TypeScript
68.6%
HTML
12.8%
JavaScript
8.4%
Pug
7%
Starlark
1.4%
Other
1.7%