Skip to content

Commit

Permalink
refactor(router): drop own constructor from the RouterLinkWithHref
Browse files Browse the repository at this point in the history
…class (#47619)

This commit updates the `RouterLinkWithHref` class to further align with the `RouterLink` class by removing own constructor from the `RouterLinkWithHref` class.

PR Close #47619
  • Loading branch information
AndrewKushnir committed Oct 4, 2022
1 parent 2f07610 commit ab4ef26
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
1 change: 0 additions & 1 deletion goldens/public-api/router/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -782,7 +782,6 @@ export class RouterLinkActive implements OnChanges, OnDestroy, AfterContentInit

// @public
export class RouterLinkWithHref extends RouterLink {
constructor(router: Router, route: ActivatedRoute, locationStrategy: LocationStrategy);
// (undocumented)
static ɵdir: i0.ɵɵDirectiveDeclaration<RouterLinkWithHref, "a[routerLink],area[routerLink]", never, {}, {}, never, never, true, never>;
// (undocumented)
Expand Down
9 changes: 9 additions & 0 deletions packages/core/test/bundling/router/bundle.golden_symbols.json
Original file line number Diff line number Diff line change
Expand Up @@ -1091,6 +1091,9 @@
{
"name": "getFactoryDef"
},
{
"name": "getFactoryOf"
},
{
"name": "getFirstLContainer"
},
Expand Down Expand Up @@ -1355,6 +1358,9 @@
{
"name": "isEmptyError"
},
{
"name": "isForwardRef"
},
{
"name": "isFunction"
},
Expand Down Expand Up @@ -1541,6 +1547,9 @@
{
"name": "noMatch2"
},
{
"name": "noSideEffects"
},
{
"name": "nodeChildrenAsMap"
},
Expand Down
8 changes: 1 addition & 7 deletions packages/router/src/directives/router_link.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
*/

import {LocationStrategy} from '@angular/common';
import {Attribute, Directive, ElementRef, HostBinding, HostListener, inject, Input, OnChanges, OnDestroy, Renderer2, SimpleChanges, ɵcoerceToBoolean as coerceToBoolean, ɵɵsanitizeUrlOrResourceUrl} from '@angular/core';
import {Attribute, Directive, ElementRef, HostBinding, HostListener, Input, OnChanges, OnDestroy, Renderer2, SimpleChanges, ɵcoerceToBoolean as coerceToBoolean, ɵɵsanitizeUrlOrResourceUrl} from '@angular/core';
import {Subject, Subscription} from 'rxjs';

import {Event, NavigationEnd} from '../events';
Expand Down Expand Up @@ -389,10 +389,4 @@ export class RouterLink implements OnChanges, OnDestroy {
standalone: true,
})
export class RouterLinkWithHref extends RouterLink {
// For backwards compatibility, constructor arguments retained an old shape.
constructor(router: Router, route: ActivatedRoute, locationStrategy: LocationStrategy) {
super(
router, route, undefined /* tabIndexAttribute */, inject(Renderer2), inject(ElementRef),
locationStrategy);
}
}

0 comments on commit ab4ef26

Please sign in to comment.