Get error Error: [$injector:unpr] Unknown provider: (Angular)

103 views Asked by At

Here my Module:

var REMOTE_SERVER_URL = 'http://139.196.141.166:8084/';

angular.module('app.payment', ['app.common','ui.router','bootstrap3-typeahead','ui.bootstrap'])
.constant('courseApiSet', {
        //course outline 
        'incomeProfile' : REMOTE_SERVER_URL+'course/income/outline',


    })
    .config(function($stateProvider) {
        $stateProvider.state('app.payment', {
            url : '/paymentManagement',
            templateUrl : 'modules/payment/views/paymentManagement.html',
            controller : 'PaymentCtrl',
                        resolve : {
                incomeProfile : ['httpService', 'courseApiSet', function(httpService, courseApiSet){
                    var url = courseApiSet.incomeProfile, data = {};
                    return httpService.postService(url,data);
                }]
            }
        })
                .state('app.paymentinfo', {
        url : '/PaymentInfo:userId',
        templateUrl : '/modules/payment/views/paymentInfo.html',
        controller : 'PaymentInfoCtrl',

    });

    });

Here my Ctrl:

angular.module('app.payment').controller('PaymentCtrl', ['incomeProfile','$scope','$state','courseApiSet','httpService', 
    function(incomeProfile,$scope, $state,courseApiSet, httpService){


        $scope.payment = incomeProfile.body;
        console.log($scope.payment);


}]);

Getting error Error: [$injector:unpr] Unknown provider: incomeProfileProvider <- incomeProfile <- PaymentCtrl

But I,m getting all data what I need from server. Why this error happens?

0

There are 0 answers