How can I open a new window when the user clicks on a link?
I have tried adding target="_blank"
and bindAttr but it doesn't work.
The code that doesn't work:
<a target="_blank" {{action goToSettings href=true}}>App Settings</a>
or
<a {{bindAttr target="_blank"}} {{action goToSettings href=true}}>App Settings</a>
And this is the html output from the first example:
<a target="_blank" href="#/settings" data-ember-action="5">App Settings</a>
This has been added to LinkView, and therefore is now supported directly in {{link-to}}
.
Pull request is at https://github.com/emberjs/ember.js/pull/4718
You have two choices:
window.open(...)
to open a new window to a particular URL<a target="_blank" {{bindAttr
href="yourBoundPropForTheUrl"}}>Click here</a>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With