问题
How to open a new browser Tab , if using router.navigate .
this.router.navigate([]).then(result => { window.location.href = link; });
回答1:
Try this one.
this.router.navigate([]).then(result => { window.open(link, '_blank'); });
回答2:
currently i believe angular doesn't offer any method or service to do that so i've to use window
object to open links in a new tab
window.open(link, '_blank')
来源:https://stackoverflow.com/questions/50521494/angular-2-routing-navigate-run-in-new-tabuse-angular-router-naviagte