Chapter 19Client-side Routing
In Chapter 18, we demonstrated how to
make Ajax requests to our Express server and load the results into
$scope to display the results. That’s great for a
single-page website, but most applications span more than a single page. In
Listing 18-2, what if we wanted to add a new screen that could be used to
edit an employee? The application needs to change pages and display a new
view, but we want to use the benefits of an Ajax request and not lose all of
our JavaScript state and static files in the browser’s memory. We also want
that page to be bookmarkable, so the page has to be stateless.
This is where client-side routing really shines. Client-side routing allows developers to create standard anchor tags throughout ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access