asp.net - ./watch 主要是在编译 JS 库文件,但它总是在缓存一个文件
问题描述
即使我正在进行更改,我也在使用 Ember,但是当我运行 ./watch 时,它不会使用新代码生成 JavaScript 文件 - 这很烦人 - 我正在手动更改,但这不是正确的解决方案吗?即使在文件夹中打开并手动更新了 ember 文件上的代码,我也对文件进行了更改 - 仍然在 app.js 文件中编写旧代码。
可能是什么原因?我正在使用 Web Pack 运行 ./watch 并生成 app.js 文件。
这是我的 Ember js 代码:
export default () => {
IMS.registerController("case.details.assignedinspector.edit", {
caseDetails: Ember.inject.controller('caseDetails'),
caseId: Ember.computed.alias('caseDetails.model.imscase.id'),
clearForm: function () {
$('.modal').modal('hide');
},
actions: {
close: function (id) {
$('.modal').modal('hide');
this.transitionToRoute('case.details');
},
async save() {
var scope = this;
//validating form
if ($("#edit-assignedinspector-form").validate()) {
var data = {
AssignedToInvestigators: Ember.get(scope, 'model.imscase.assignedToInvestigators'), //AssignedToInspectorId: $("#assignedInspectorSelect").chosen().val(),
CaseId: this.get('caseId')
};
try {
let response = await this.api('Case/UpdateAssignedInvestigators').post(data);
$('.modal').modal('hide');
toastr.success("Assigned Inspector Edit Saved.");
scope.transitionToRoute("case.details");
scope.get('caseDetails').refreshData();
scope.clearForm();
} catch (ex) {
toastr.error("Error saving Assigned Inspector.");
}
}
else {
toastr.warning("Please fix the form", "Validation failed");
}
},
didInsert: function () {
$('#edit-assignedinspector-modal').modal();
}
}
});
}
以下是它如何在 app.js 文件中生成旧代码:
save: function () {
var _save = _asyncToGenerator(
/*#__PURE__*/
regeneratorRuntime.mark(function _callee() {
var scope, data, response;
return regeneratorRuntime.wrap(function _callee$(_context) {
while (1) {
switch (_context.prev = _context.next) {
case 0:
scope = this; //validating form
if (!$("#edit-assignedinspector-form").validate()) {
_context.next = 19;
break;
}
data = {
AssignedToInspectorId: $("#assignedInspectorSelect").chosen().val(),
CaseId: this.get('caseId')
};
_context.prev = 3;
_context.next = 6;
return this.api('Case/UpdateAssignedInspector').post(data);
case 6:
response = _context.sent;
$('.modal').modal('hide');
toastr.success("Assigned Inspector Edit Saved.");
scope.transitionToRoute("case.details");
scope.get('caseDetails').refreshData();
scope.clearForm();
_context.next = 17;
break;
case 14:
_context.prev = 14;
_context.t0 = _context["catch"](3);
toastr.error("Error saving Assigned Inspector.");
case 17:
_context.next = 20;
break;
case 19:
toastr.warning("Please fix the form", "Validation failed");
case 20:
case "end":
return _context.stop();
}
}
}, _callee, this, [[3, 14]]);
}));
function save() {
return _save.apply(this, arguments);
}
return save;
}()
它应该调用 Case/UpdateAssignedInvestigators,而不是它仍然调用 Case/UpdateAssignedInspector,这是不正确的。
解决方案
推荐阅读
- php - 注意:未定义索引:sort_data
- r - 为什么我在我的 r 代码中创建的公式不起作用
- android - FCM 在 Windows、Android 中无法与 Firefox 一起使用(消息传递/内部错误)
- python - 关于python2.7中韩语单词的ElementTree Unicode编码错误
- mongodb - 使用jhipster框架配置mongodb提示未授权
- python - UUID 到(十六进制数组?)
- javascript - 如果支持 Web 共享 API,它应该显示本机共享对话框,否则它应该转到锚标记的 href 中定义的 URL
- android - viewModel.setTitle(text) 是 android 中的反模式?
- javascript - 获取重复键错误,但未在集合中设置唯一属性
- date - 应用程序脚本上的区域时间和日期到谷歌表未转换为本地时间