‘Resolve’ comes to our rescue when we want to fetch some data or check some condition before loading the view. Resolve is a list of tasks that should be done before the controller instantiates or the view is loaded.
In our last post, we saw how to get data from a JSON file. In this post, we will see how to make an API call to get data.
In our last post, Fetching Data in Angularjs we saw how to fetch data stored in the controller. This post we will learn how to fetch data stored in a service.