How To Navigate To External Website In Angular

4 Ways with examples

Bhargav Bachina
Bachina Labs

--

Photo by Oskar Kadaksoo on Unsplash

Single Page Applications behave in a different way. They don’t reload the page every time you get the data from the server. They load the index.html page first which contains all the necessary CSS and javascript files. The entire application and any framework related stuff are in those JS files. As soon as you load the index.html, the javascript files are rendered in the browser and the Angular framework kicks in and does the magic.

When you refresh or reload the page you are actually reloading the index.html which inturn reloads all the CSS and JS files. Sometimes we have to navigate from Single Page App to any other app. In this post, we will see how many ways we can navigate from the Angular app to any external website or another Angular app.

  • Example Project
  • With Window Object
  • With Href Tag
  • With Resolver
  • With Jquery
  • Summary
  • Conclusion

Example Project

Here is an example project for the demonstration of these 4 ways. You can clone this and run on your local machine.

// clone the project
git clone…

--

--