fix(ngRouteShim): update anchors to function similar to angular 1.x (#8478)
* fix(ngRouteShim): update anchors to function similar to angular 1.x when setting the target * fix(ngRouteShim): update anchor target check to use indexOf instead of contains on array
This commit is contained in:
parent
b2a7fd05cb
commit
be48ba1b06
|
@ -281,7 +281,10 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
var href = element.attr(hrefAttrName);
|
var href = element.attr(hrefAttrName);
|
||||||
if (href && $rootRouter.recognize(href)) {
|
var target = element.attr('target');
|
||||||
|
var isExternal = (['_blank', '_parent', '_self', '_top'].indexOf(target) > -1);
|
||||||
|
|
||||||
|
if (href && $rootRouter.recognize(href) && !isExternal) {
|
||||||
$rootRouter.navigateByUrl(href);
|
$rootRouter.navigateByUrl(href);
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue