Tutorialsplane

AngularJs open link in new tab


AngularJs open link in new tab – You can use $window service to open a link in new tab in angularjs. It is very easy to open link in new tab using AngularJs. Here in this tutorial we are going to explain how you can use the $window service to open link in new tab. You can also use our online editor to edit and run the example code.


AngularJs open link in new tab

You can open a link in new tab using the following steps-

JavaScript Part –

JavaScript Part Contains the following script –

AngularJs open link in new tab Example:


Html Part –

This Contains the html part of the example –

AngularJs open link in new tab Example:

 <div ng-app="myApp">  
<div ng-controller="myController">  
 
</div> 

</div>

Complete Part – Html & JavaScript Both

Let us combine the javascript and html both part to create the complete example –

AngularJs open link in new tab Example:




 
 

  
<div ng-app="myApp">  
<div ng-controller="myController">  
 
</div> 

  
      


</div>

Try it »

If you run the above example it will produce the output something like this –