Angular - 显式注释

时间:2017-05-08 20:17:26

标签: javascript angularjs

我的代码遇到了以下问题:

Error: [$injector:strictdi] controller is not using explicit annotation and cannot be invoked in strict mode

我已经实现了如下所示的显式注释,但仍然无法使其工作。

var paymentSummaryTemplate = require('./paymentsummary.html');

function PaymentController($scope, $log, $translate) {
    ...
}

PaymentController.$inject = ['$scope','$log', '$translate'];

p3dng
  .controller('PaymentController', PaymentController)
  .config(['$routeProvider', function($routeProvider) {
    $routeProvider.when('/paymentsummary', {
        templateUrl: paymentSummaryTemplate,
        controller: PaymentController,
        controllerAs: 'paymentsummary',
        resolve: getInitData(['campaign', 'event'])
    });
}]);

0 个答案:

没有答案