ASP.NET Boilerplate(Core 2.0 + Angular 5)中的Promise错误免费模板 [英] Promise error in ASP.NET Boilerplate (Core 2.0 + Angular 5) Free Template
问题描述
我一直在使用ASP.NET Boilerplate通过使用自定义API的REST API客户端(如Postman)对数据库进行CRUD操作,到目前为止,它运行良好.
I have been using ASP.NET Boilerplate to do CRUD Operations with the database with a REST API client like Postman using custom APIs and so far , it's working quite well.
但是当我转到前端部分时,使用管理员帐户登录后,用户组件中有未处理的异常.首先,我可以看到添加的用户列表,从中可以说Create
和Get
操作正常运行(我还测试了编辑用户,并且运行良好).当我到达"Deleting
"用户时,我可以在控制台输出中看到一个异常,如图所示:
But then when I move on to the frontend part, there is an unhandled exception in Users Component after logging in with an Admin account. First of all, I can see the list of users that I added, from which I can say the Create
and Get
operations are running properly (I also tested editing the users and it worked well). When I get to "Deleting
" the users, I can see an exception in the console output as shown in the picture:
我以为我弄乱了一些代码,所以我重新下载了整个模板,然后重新开始,再次执行删除操作. 错误仍然存在.
I thought I had somehow messed up some of the codes, so I redownloaded the whole template and started freshly to performed the delete operation again. The error still persists.
此外,当我在service-proxies.tx
中添加自己的服务类并在其service-proxy.module.ts
中导出它,并将服务注入到app.component
和console.log
中的构造函数中时,我仍然得到相同的结果
Moreover, when I add my own service class in the service-proxies.tx
and export it in its service-proxy.module.ts
, and inject the service into the app.component
and console.log
the response in the constructor, I still get the same exception.
请帮助我深入探讨问题的根源.谢谢.
Please help me dig to the root of the problem. Thank you.
这是HTML行中的代码:50:
Here is the code in HTML line: 50:
<li>
<a href="javascript:void(0);" class="waves-effect waves-block" (click)="delete(user)">
<i class="material-icons">delete_sweep</i>{{l('Delete')}}</a>
</li>
在TS端,它正在使用User
DTO调用delete
函数.
在TS端,delete(User)
看起来像:
On, the TS side, it is calling the delete
function with User
DTO.
On the TS side, the delete(User)
looks like:
protected delete(user: UserDto): void {
abp.message.confirm(
"Delete user '" + user.fullName + "'?",
(result: boolean) => {
if (result) {
this._userService.delete(user.id)
.subscribe(() => {
abp.notify.info("Deleted User: " + user.fullName);
this.refresh();
});
}
}
);
}
我将SweetAlert版本从1.1.3升级到了2.0.8,应用程序甚至无法编译.根据一些GitHub线程,我应该重写一些与SweetAlert模块相关的功能.但是随后错误消息说该应用程序甚至无法找到.....node_modules\sweetalert\dist\sweetalert.css.js
推荐答案
ABP v3.2.0 有一些重大更改:
#2145 升级到sweetalertv2.x. 现有应用程序应将Sweetalert软件包升级到v2.x.
#2145 Upgrade to sweetalert v2.x. Existing applications should upgrade sweetalert packages to v2.x.
免费模板可能尚未升级.
The free template may not have upgraded that yet.
您可以升级到SweetAlert v2.0.8.使用 yarn 之前,请删除 node_modules 文件夹.
You can upgrade to SweetAlert v2.0.8. Remove the node_modules folder before using yarn.
您现在可以下载 v3.4.1
带有SweetAlert升级的模板.
You can now download v3.4.1
of the template with the SweetAlert upgrade.
这篇关于ASP.NET Boilerplate(Core 2.0 + Angular 5)中的Promise错误免费模板的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!