Eusebiu Schipor Let’s talk tech!

  • It make UI state central and supports nested views.
  • In the traditional client-server communication, for every update on the page, the browser will make another request to the server and the server responds with the contents for the entire page.
  • The process might be making an AJAX call to the server to retrieve the relevant template for the view, but it’s not mandatory.
  • Even in a simple app, we will have at least a couple of different views, where the content from a page will be replaced with some other content.
  • With AJAX we can make a background request to the server, which only return the needed data, and we don’t need to load all the page content again.


Even in a simple app, we will have at least a couple of different views, where the content from a page will be replaced with some other content. In the traditional client-server
communication, for every update on the page, the browser will make another request to the server and the server responds with the contents for the entire page. So, the
routing from one point to another was clearly a server side responsibility.


@eusebiuschipor: Routing in AngularJS 1.x: #angularjs #javascript #frontend

Posted on January 13, 2017

Even in a simple app, we will have at least a couple of different views, where the content from a page will be replaced with some other content. In the traditional client-server communication, for every update on the page, the browser will make another request to the server and the server responds with the contents for the entire page. So, the routing from one point to another was clearly a server side responsibility.

With the AJAX, we can improve quite a bit the whole process. With AJAX we can make a background request to the server, which only return the needed data, and we don’t need to load all the page content again. In the Single Page Application model, we use that principle: when the user enter a new URL that’s supposed to take them to a new view, the URL is constructed with the same URL as before, followed by a pound sign. This process might be making an AJAX call to the server to retrieve the relevant template for the view, but it’s not mandatory.

In a AngularJS app, we can chose from two packages that help us to implement routing: ngRoute and ui-router.

ngRoute is developed by Google and the AngularJS community. It restricts every route to be represented by a URL and have no concept of nested views.

ui-router is developed just by AngularJS community. It make UI state central and supports nested views. It is considered a better choice for serious and large projects. Next in this post I will go over the steps on how to use ui-router.

Eusebiu Schipor Let’s talk tech!