0

I would like to enable "Open in new window / tab" on button. Frankly, I tried many ways, and unluckily it doesn't work.

Here is my button:

<button class="button no-margin-bottom" data-ng-click="vm.navigateToProject(project)"
data-sd-secured
data-sd-secured-contextual="project.permissions.canViewProjectDetails"
data-translate>PROJECTS.VIEW</button>

Any ideas?

Konrad R
  • 65
  • 1
  • 10

1 Answers1

1

What is it that you want to achieve with the new window / tab? To run your angular application in parallel, or just to have an external link?

If you want to run it in parallel, then there will be a few issues that you'll come across concerning the shared data. You can read more in this post: AngularJS: open a new browser window, yet still retain scope and controller, and services

But if you just want an option to open a new tab, then that can be done fairly easily: Simplest - html solution: <a href="#" target="_blank">link/button</a>

or by using javascript alone: window.open('https://stackoverflow.com/', '_blank'); Here you can see more about that approach How to open a URL in a new Tab using javascript or jquery?

Or eventually implementing it in angular Open links in new window using AngularJS

Community
  • 1
  • 1
Nemanja Milosavljevic
  • 1,251
  • 18
  • 33