如何使用Kendo解决AngularJS中未知的提供程序问题?

时间:2015-03-16 15:25:21

标签: angularjs kendo-ui

我想将数据填充到kendo网格中,但我收到错误未知提供程序:Error: [$injector:unpr] Unknown provider: promiseObjProvider <- promiseObj <- ProcessController <- ProcessController。我不知道我在哪里犯错。请看下面的代码,并建议我如何解决这个问题。

createEditProcess.html

<div class="panel panel-primary">
        <div class="panel-heading">
        <label ng-hide="editMode">Create New Process </label>
            <label ng-show="editMode">Edit Process </label>
        </div>
            <div class="tabContent">
                <form name="createProcessFormName" id="createProcessForm"
                    name="form" role="form" class="form-horizontal"
                    kendo-validator="validator" k-validate-on-blur="false" k-options="myValidatorOptions" ng-submit="validate($event)">
                    <div kendo-window="ERHPopup" k-title=""
                         k-width="350" k-height="100" k-visible="false" >
                         <div><span>This Process Has Risks And Controls Aligned To It. Please Review And Adjust Those If Necessary</span></div>
                    </div>
                    <div kendo-window="geographicLocationsPopup" k-title=""
                         k-width="350" k-height="100" k-visible="false" >
                         <div><span>This Process Has Risks And Controls Aligned To It. Please Review the Risks and Controls</span></div>
                    </div>
                    <div kendo-window="legalEntitiesPopup" k-title=""
                         k-width="350" k-height="100" k-visible="false" >
                         <div><span>This Process Has Risks And Controls Aligned To It. Please Review the Risks and Controls</span></div>
                    </div>
                    <div kendo-window="EPCFPopup" k-title=""
                         k-width="350" k-height="100" k-visible="false" >
                         <div><span>This Process Has Risks And Controls Aligned To It. Please Review The Risks And Controls</span></div>
                    </div>
                    <ng-include src="'views/createEditProcessContent.html'"></ng-include>
                </form>
            </div>
</div>
<div kendo-window="confirmationWin" options="confirmationWinOptions" class="confirmationWin"></div> 
    </script>

processController.JS

angular.module('riskAssessmentApp').controller('ProcessController', function($scope, Process,TreeViewData, $rootScope, 
        $routeParams, ViewEditPrcsService, kendoCustomDataSource, $http,EPCFHirachyInfo,ERhHirachyInfo, 
        $location,alert,ProcessUpdate, ihtRskRatingGridConfig, processTreeConfig, alignedRisksHeaderPallette, alignedRisksModal, 
        riskToControlGridDataService,controlToProcessConfig,savaControlToProcessGrid, riskRatingGrid,savaControlToProcessNoAlignGrid, processRatingGridConfig, Rating, alignExstRskDataService, alignedCtrlsHeaderPallette, alignExstRiskGrid,ConfirmationConfig,promiseObj) {
    'use strict';
         var resetDataPrt = function() {
      return new kendo.data.DataSource({
          data: $scope.processRating,
          navigatable: true,
          pageSize: 100
      });
  };

      if($scope.editMode){
          $scope.ihtRskRatingGridOptions = ihtRskRatingGridConfig.ihtRskRatingGrid; 
          ihtRskRatingGridConfig.ihtRskRatingGrid.dataSource = resetData2();

          $scope.processRating = promiseObj.data;
          $scope.processRatingGridOptions = processRatingGridConfig.processRatingGrid; 
          processRatingGridConfig.processRatingGrid.dataSource = resetDataPrt();



});

APP.JS

.when('/process/create', {
                templateUrl : 'views/createEditProcess.html',
                controller : 'ProcessController',
                resolve: {
                  promiseObj: function(Rating){
                      return Rating.getAllProcessRatings();
                  }
                }
            })

processGrid.js

    angular.module('riskAssessmentApp').value('processRatingGridConfig', {
    processRatingGrid: {
        columns: [{
            field: 'ratingDateHistory',
            title: 'History',
            width: '8em'
        }, {
            field: 'irrComputed',
            title: 'Process Inherent Risk Rating Computed',
            width: '10em'
        }, {
            field: 'irrFinalOutcome',
            title: 'Process Inherent risk business Final',
            width: '10em'
        }, {
            field: 'mssControlFlag',
            title: 'Missing controls',
            width: '10em'
        }, {
            field: 'computedEffectiveRating',
            title: 'Overall Control Effectiveness Computed',
            width: '10em'
        }, {
            field: 'businessEffectiveRating',
            title: 'Overall Control Effectiveness Business',
            width: '10em'
        }, {
            field: 'effectiveJustification',
            title: 'Control Effectiveness Business Justification',
            width: '10em'
        }, {
            field: 'residualRiskComputed',
            title: 'Residual Risk Computed',
            width: '10em'
        }, {
            field: 'businessResidualRisk',
            title: 'Residual Risk Business',
            width: '10em'
        }, {
            field: 'residualRiskJustification',
            title: 'Residual Risk Business Justification',
            width: '10em'
        }, {
            field: 'riskDescription',
            title: 'Risk Description',
            width: '10em'
        }, {
            field: 'riskAcceptanceFlag',
            title: 'Risk Acceptance',
            width: '10em'
        }, {
            field: 'riskAcceptanceRationale',
            title: 'Risk Acceptance Rationale',
            width: '10em'
        }]
    },

});

Factory.js

angular.module("riskAssessmentApp").factory('Rating', function($http, $location) {
        getAllUpdateQuestions: function (prcsSessionKey) {
            return $http.get('app/processrating/rest/getProcessRating/' +prcsSessionKey);
        },
        getAllProcessRatings: function (processKey) {
            return $http.get('app/processrating/rest/getProcessRatings/' + processKey);
        }
    };
});

1 个答案:

答案 0 :(得分:1)

在一行中:<div class="panel panel-primary" ng-controller>删除ng-controller