An example of using resolve in angularjs ngRoutes