我的代码遇到了以下问题:
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'])
});
}]);