0
我寫了一組縮小JS代碼的gulp命令。它工作正常,除非我在特定的JS文件中包含以下代碼段。用一些Angular modalInstance打開縮小錯誤。打開方法
//============================== Ledger Card Modal =================================== //KR: Check
vm.ledgerCardWindowOption = function (matterReferenceNo) {
var busy = busyIndicatorService.setAsBusy('CompanyName.main');
vm.ledgerCardGlyphicon = true;
$scope.modalInstance = $modal.open({
scope: $scope,
templateUrl: 'app/ledgerCard/ledgerCardView.html',
backdrop: 'static',
controller: 'ledgerCardController as vm',
windowClass: 'ledgercard-modal-window',
resolve: {
ledgerCardModal: function() {
var data = { matterReferenceNo: matterReferenceNo, formType: "Modal" };
return data;
}
}
});
$scope.modalInstance.opened.then(() => busy.resolve(),() => busy.resolve()); // This is the bad line
};
//============================== Ledger Card Modal End ===================================
//==============================auto height fix===================================
錯誤消息:
events.js:72
throw er; // Unhandled 'error' event
^
Error
at new JS_Parse_Error (eval at <anonymous> (C:\dev.net14\DevelopmentPhase2\CompanyName.WebMain\node_modules\uglify-js\tools\node.js:30:4), <anonymous>:1533:18)
at js_error (eval at <anonymous> (C:\dev.net14\DevelopmentPhase2\CompanyName.WebMain\node_modules\uglify-js\tools\node.js:30:4), <anonymous>:1541:11)
at croak (eval at <anonymous> (C:\dev.net14\DevelopmentPhase2\CompanyName.WebMain\node_modules\uglify-js\tools\node.js:30:4), <anonymous>:2088:9)
at token_error (eval at <anonymous> (C:\dev.net14\DevelopmentPhase2\CompanyName.WebMain\node_modules\uglify-js\tools\node.js:30:4), <anonymous>:2096:9)
at unexpected (eval at <anonymous> (C:\dev.net14\DevelopmentPhase2\CompanyName.WebMain\node_modules\uglify-js\tools\node.js:30:4), <anonymous>:2102:9)
at expr_atom (eval at <anonymous> (C:\dev.net14\DevelopmentPhase2\CompanyName.WebMain\node_modules\uglify-js\tools\node.js:30:4), <anonymous>:2617:13)
at maybe_unary (eval at <anonymous> (C:\dev.net14\DevelopmentPhase2\CompanyName.WebMain\node_modules\uglify-js\tools\node.js:30:4), <anonymous>:2791:19)
at expr_ops (eval at <anonymous> (C:\dev.net14\DevelopmentPhase2\CompanyName.WebMain\node_modules\uglify-js\tools\node.js:30:4), <anonymous>:2826:24)
at maybe_conditional (eval at <anonymous> (C:\dev.net14\DevelopmentPhase2\CompanyName.WebMain\node_modules\uglify-js\tools\node.js:30:4), <anonymous>:2831:20)
at maybe_assign (eval at <anonymous> (C:\dev.net14\DevelopmentPhase2\CompanyName.WebMain\node_modules\uglify-js\tools\node.js:30:4), <anonymous>:2855:20)
我已經指出了上面的代碼中的壞行,但我無法弄清楚什麼是錯在那裏。任何人都可以解釋我嗎?