mirror of
https://github.com/angular/angular
synced 2026-05-24 09:28:37 +00:00
In early versions of Angular, it was sometimes necessary to provide a `moduleId` to `@Component` metadata, and the common pattern for doing this was to set `moduleId: module.id`. This relied on the bundler to fill in a value for `module.id`. However, due to the superficial similarity between `Component.moduleId` and `NgModule.id`, many users ended up setting `id: module.id` in their NgModules. This is an anti-pattern that has a few negative effects, including preventing the NgModule from tree-shaking properly. This commit changes the compiler to ignore `id: module.id` in NgModules, and instead provide a warning which suggests removing the line entirely. PR Close #45024 |
||
|---|---|---|
| .. | ||
| index.md | ||
| NG0100.md | ||
| NG0200.md | ||
| NG0201.md | ||
| NG0300.md | ||
| NG0301.md | ||
| NG0302.md | ||
| NG1001.md | ||
| NG2003.md | ||
| NG2009.md | ||
| NG3003.md | ||
| NG6100.md | ||
| NG6999.md | ||
| NG8001.md | ||
| NG8002.md | ||
| NG8003.md | ||