Implementing nested ui-router resolves

As you gain experience as an AngularJS developer, you will come to realize that the built-in router faculties are quite brittle in a number of ways—mainly that there can only be a single instance of ng-view for dynamic route templating. AngularUI provides a superb solution to this in ui-router, which allows nested states and views, named views, piecewise routing, and nested resolves.

How to do it…

The ui-router framework supports resolves for states in the same way that ngRoute does for routes. Suppose your application displayed individual widget pages that list the features each widget has, as well as individual pages for each widget's features.

State promise inheritance

Since nested states can be defined with ...

Get AngularJS Web Application Development Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.