Client-side routing

Most apps today use client-side routing, which helps with the following key aspects:

  • App sections can be made shareable and navigable. For example, the Everyday Market app could benefit substantially if users were able to share links that display a specific product directly.
  • Properly designed routes can make the user understand the context better. Additionally, users might find it trivial enough to even change the URL manually to get to the page or level they want.
  • Client-side routing also improves usability through integration with the built-in back and forward browser buttons.
  • Combined with isomorphic (server-side) rendering, client-side routing can assist greatly with Search Engine Optimization (SEO).

Client-side routing is made possible due to the fact that the app can tweak the browser URL to reflect certain areas it chooses to support routing for. For many years, the use of named anchors, via the hash symbol (#), was used to implement routes. Thanks to the newer HTML5 history push API, app developers can tweak the URL without the hash sign, and thus apply more intuitive and readable routes, without having the browser refresh the app.

Angular, being the comprehensive framework that it is, brings a complete solution for client-side routing via its RoutingModule and Angular Router.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.147.89.30