我如何使用角度语言服务?

时间:2017-08-16 14:06:44

标签: angular typescript atom-editor

我想使用能够在模板文件上完成的角度语言服务功能。

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

我已经添加修复了要在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。所以我很确定它有效。把一些日志跟踪,我可以看到角度语言服务确实初始化。

我错过了什么?

1 个答案:

答案 0 :(得分:0)