【发布时间】:2025-12-12 22:35:04
【问题描述】:
我正在尝试将 ionic 4 作为前端集成到 aspnetboilerplate 后端 API。
我已经从示例 Angular 前端复制了一些代码,并添加了我需要的所有包。我只复制了 auth 文件夹和服务代理文件夹,因此我可以将 ASP .net 样板身份验证添加到 ionic 应用程序。 VS Code 没有检测到 abp 包并显示导入错误,直到我还复制了 typings.d.ts 文件,它删除了编辑器中的错误。
//typings.d.ts snippet
///<reference path="../node_modules/abp-web-resources/Abp/Framework/scripts/abp.d.ts"/>
///<reference path="../node_modules/abp-web-resources/Abp/Framework/scripts/libs/abp.jquery.d.ts"/>
///<reference path="../node_modules/abp-web-resources/Abp/Framework/scripts/libs/abp.signalr.d.ts"/>
尝试使用 ionic serve 运行应用程序时,我遇到了与添加 typings.d.ts 文件之前相同的错误。
ERROR in node_modules/abp-ng2-module/dist/src/features/feature-checker.service.d.ts:2:31 - error TS2503: Cannot find namespace 'abp'.
src/account/account.component.ts:34:9 - error TS2592: Cannot find name '$'. Do you need to install type definitions for jQuery? Try `npm i @types/jquery` and then add `jquery` to the types field in your tsconfig.
我认为问题在于 VS Code 正在识别 typings.d.ts 文件,而实际的 ionic typescript 安装不是。
【问题讨论】:
标签: angular typescript ionic-framework aspnetboilerplate