mirror of
https://github.com/angular/angular
synced 2026-05-24 09:28:37 +00:00
fix(router): avoid component ID collisions with user code (#59300)
Currently the `ɵEmptyOutletComponent` is very prone to generating ID collision warnings with user code, because it only has one child and no other metadata. This shows up some of our tests as well. While users can resolve it on their end, it can be confusing since they won't have any references to `ɵEmptyOutletComponent` in their own code. These changes add an `exportAs` to it to make its component ID unique. This doesn't affect the public API of the component since users can't use it directly anyways. PR Close #59300
This commit is contained in:
parent
a088208690
commit
5ac6f065ab
1 changed files with 3 additions and 1 deletions
|
|
@ -23,8 +23,10 @@ export {ɵEmptyOutletComponent as EmptyOutletComponent};
|
|||
* to this `EmptyOutletComponent`.
|
||||
*/
|
||||
@Component({
|
||||
template: `<router-outlet></router-outlet>`,
|
||||
template: `<router-outlet/>`,
|
||||
imports: [RouterOutlet],
|
||||
// Used to avoid component ID collisions with user code.
|
||||
exportAs: 'emptyRouterOutlet',
|
||||
})
|
||||
export class ɵEmptyOutletComponent {}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue