相关疑难解决方法(0)

如何在Angular2中显示应用程序版本?

如何在angular2应用程序中显示应用程序版本?该版本应从package.json文件中获取

{
  "name": "angular-app",
  "version": "0.0.1",
  ...
}
Run Code Online (Sandbox Code Playgroud)

在角1.x,我有这个HTML:

<p><%=version %></p>
Run Code Online (Sandbox Code Playgroud)

在angular2中,这不会呈现为版本号,而是按原样(<%=version %>而不是0.0.1)打印.

version package.json angular

104
推荐指数
12
解决办法
5万
查看次数

resolveJsonModule 在 Angular 10 中不起作用?

我在一个全新的 Angular 10 项目的资产文件夹中有一个基本的 JSON 文件。
Angular CLI:10.0.1 节点:14.5.0 操作系统:win32 x64 TSC 版本 3.9.5。在我的 tsconfig.json 我有

  "compilerOptions": {
    "module": "commonjs",
    "resolveJsonModule": true,
    "esModuleInterop": true
  }
Run Code Online (Sandbox Code Playgroud)

I have restarted vscode multiple times, and tried compiling from the vscode terminal, a powershell window, and a bash terminal, all returning the same message: "Consider using '--resolveJsonModule' to import module with '.json' extension". I have tried compiling with multiple combinations of different options. At this point I'm wondering if I should restart this project …

typescript angular angular10

13
推荐指数
3
解决办法
8205
查看次数

标签 统计

angular ×2

angular10 ×1

package.json ×1

typescript ×1

version ×1