mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08: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:
committed by
Jessica Janiuk
parent
a088208690
commit
5ac6f065ab
@@ -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 {}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user