【问题标题】:How do I use angular language service?如何使用 Angular 语言服务?
【发布时间】:2018-01-24 17:28:42
【问题描述】:

我想使用能够对模板文件进行补全的 Angular 语言服务功能。

我正在尝试让插件与我使用的 Atom 包一起使用 atom-typescript

我已经添加了要在 html 文件上激活的包。

这是我的 tsconfig.json 文件

{
  "compileOnSave": false,
  "compilerOptions": {
    "outDir": "./dist/out-tsc",
    "sourceMap": true,
    "declaration": false,
    "moduleResolution": "node",
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "target": "es5",
    "typeRoots": [
      "node_modules/@types"
    ],
    "plugins": [{ "name": "@angular/language-service" }],
    "lib": [
      "es2016",
      "dom"
    ]
  }
}

这是 package.json

  "dependencies": {
    "@angular/animations": "^4.0.0",
    "@angular/common": "^4.0.0",
    "@angular/compiler": "^4.0.0",
    "@angular/core": "^4.0.0",
    "@angular/forms": "^4.0.0",
    "@angular/http": "^4.0.0",
    "@angular/platform-browser": "^4.0.0",
    "@angular/platform-browser-dynamic": "^4.0.0",
    "@angular/router": "^4.0.0",
    "core-js": "^2.4.1",
    "rxjs": "^5.4.1",
    "zone.js": "^0.8.14"
  },
  "devDependencies": {
    "@angular/cli": "1.2.2",
    "@angular/compiler-cli": "^4.0.0",
    "@angular/language-service": "^4.3.4",

atom-typescript 使用 typescripts tsserver。所以我很确定这行得通。放一些日志跟踪,我可以看到 Angular 语言服务确实被初始化了。

我错过了什么?

【问题讨论】:

    标签: angular typescript atom-editor


    【解决方案1】:
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2023-02-15
    • 2020-08-15
    • 2019-06-20
    • 2017-04-18
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多