AngularJS injection error in a resolve

I’m trying to get user profile metadata into a resolve as a promise which is then used by another promise get information based on a value in the user profile.

    $routeProvider.when('/wapmap', {
        templateUrl:  'wap_tools/wap_map.html',
        controller: 'wapMapClr',
        resolve: {
            mapres: function(profilePromise, service2) {
                profilePromise.then(function(profile) {
                    var viewerId = profile.app_metadata.viewers[1].viewerId;
                     return service2.getPromise(viewerId)
                })
                     .then(function(response2) {    
                       makelayerGroup(response2);
                       mapView(response2);
                       hasPhotos = response2.vwrSettings[0].photos;
                       return
                  })
            })
          }
        },
        requiresLogin: true
    });

This throws the following error:

    [$injector:unpr] http://errors.angularjs.org/1.5.8/$injector/unpr?p0=profilePromiseProvider%20%3C-%20profilePromise%20%3C-%20mapres
        at angular.min.js:6
        at angular.min.js:43
        at Object.d [as get] (angular.min.js:40)
        at angular.min.js:43
        at d (angular.min.js:40)
        at e (angular.min.js:41)
        at Object.invoke (angular.min.js:41)
        at angular-route.min.js:10
        at Object.q [as forEach] (angular.min.js:8)
        at angular-route.min.js:10 

So this looks like an injection error – how do I get the profilePromise data into the resolve?

Source: AngularJS