fix(router): set href when routerLink is used on an 'area' element (#28441)

closes #28401

PR Close #28441
This commit is contained in:
kevinphelps
2019-01-29 23:48:03 -06:00
committed by Matias Niemelä
parent 4ceb655c11
commit ed0cf7e2cb
2 changed files with 21 additions and 2 deletions

View File

@ -111,7 +111,7 @@ import {UrlTree} from '../url_tree';
*
* @publicApi
*/
@Directive({selector: ':not(a)[routerLink]'})
@Directive({selector: ':not(a):not(area)[routerLink]'})
export class RouterLink {
// TODO(issue/24571): remove '!'.
@Input() queryParams !: {[k: string]: any};
@ -191,7 +191,7 @@ export class RouterLink {
*
* @publicApi
*/
@Directive({selector: 'a[routerLink]'})
@Directive({selector: 'a[routerLink],area[routerLink]'})
export class RouterLinkWithHref implements OnChanges, OnDestroy {
// TODO(issue/24571): remove '!'.
@HostBinding('attr.target') @Input() target !: string;