Javascript 如何在angular cli中使用@Gbuomprisco/ng2标记输入?
我正在使用@angular/cli的最新版本(1.0.0-beta.32.3),我正在尝试使用。 启动ng serve命令时,出现以下错误:Javascript 如何在angular cli中使用@Gbuomprisco/ng2标记输入?,javascript,angular,angular-cli,ng2-tag-input,Javascript,Angular,Angular Cli,Ng2 Tag Input,我正在使用@angular/cli的最新版本(1.0.0-beta.32.3),我正在尝试使用。 启动ng serve命令时,出现以下错误: ERROR in Error encountered resolving symbol values statically. Only initialized variables and constants can be referenced because the value of this variable is needed by the templ
ERROR in Error encountered resolving symbol values statically. Only initialized variables and constants can be referenced because the value of this variable is needed by the template compiler (position 5:22 in the original .ts file), resolving symbol Ng2DropdownModule in my-project/node_modules/ng2-tag-input/dist/node_modules/ng2-material-dropdown/index.d.ts, resolving symbol TagInputModule in my-project/node_modules/ng2-tag-input/dist/modules/ng2-tag-input.module.d.ts, resolving symbol TagInputModule in my-project/node_modules/ng2-tag-input/dist/modules/ng2-tag-input.module.d.ts
webpack: Failed to compile.
你知道怎么解决这个问题吗
这是我的package.json:
{
"name": "my-project",
"version": "0.0.0",
"license": "MIT",
"angular-cli": {},
"scripts": {
"ng": "ng",
"start": "ng serve --proxy-config proxy.conf.json",
"lint": "tslint \"src/**/*.ts\" --project src/tsconfig.json --type-check && tslint \"e2e/**/*.ts\" --project e2e/tsconfig.json --type-check",
"test": "ng test",
"pree2e": "webdriver-manager update --standalone false --gecko false",
"e2e": "protractor",
"build": "ng build --aot"
},
"private": true,
"dependencies": {
"@angular/common": "^2.3.1",
"@angular/compiler": "^2.3.1",
"@angular/core": "^2.3.1",
"@angular/forms": "^2.3.1",
"@angular/http": "^2.3.1",
"@angular/platform-browser": "^2.3.1",
"@angular/platform-browser-dynamic": "^2.3.1",
"@angular/router": "^3.3.1",
"bootstrap-sass": "^3.3.7",
"core-js": "^2.4.1",
"font-awesome": "^4.7.0",
"jquery": "^3.1.1",
"ng2-tag-input": "^0.8.5",
"rxjs": "^5.0.1",
"tinymce": "^4.5.3",
"ts-helpers": "^1.1.1",
"zone.js": "^0.7.2"
},
"devDependencies": {
"@angular/cli": "^1.0.0-beta.32.3",
"@angular/compiler-cli": "^2.3.1",
"@types/jasmine": "2.5.38",
"@types/node": "^6.0.42",
"@types/tinymce": "^4.5.0",
"angular-cli": "1.0.0-beta.26",
"codelyzer": "~2.0.0-beta.1",
"jasmine-core": "2.5.2",
"jasmine-spec-reporter": "2.5.0",
"karma": "1.2.0",
"karma-chrome-launcher": "^2.0.0",
"karma-cli": "^1.0.1",
"karma-jasmine": "^1.0.2",
"karma-remap-istanbul": "^0.2.1",
"protractor": "~4.0.13",
"ts-node": "1.2.1",
"tslint": "^4.3.0",
"typescript": "~2.0.3"
}
}
和我的app.module.ts
import { BrowserModule } from "@angular/platform-browser";
import { NgModule } from "@angular/core";
import { FormsModule } from "@angular/forms";
import { HttpModule } from "@angular/http";
import { TagInputModule } from 'ng2-tag-input';
import { RouterModule } from "@angular/router";
import { ROUTES } from "./app.routes";
import { AppComponent } from "./app.component";
@NgModule({
declarations: [ AppComponent ],
imports: [
BrowserModule,
FormsModule,
HttpModule,
TagInputModule,
RouterModule.forRoot(ROUTES, { useHash: true })
],
providers: [ ],
bootstrap: [AppComponent]
})
export class AppModule {
}
谢谢你的帮助 正如Galvan所建议的,使用ng2标记输入的0.8.6版节省了我的时间(谢谢!)
我已经提交了一份报告,以便他们可以按照Galvan的建议更新npm注册表,使用ng2标记输入的0.8.6版保存了我的一天(谢谢!)
我已经提交了一份文件,以便他们可以更新npm注册表您能在package.json文件中将此“ng2标记输入”^0.8.5改为“ng2标记输入”:“0.8.6”吗?(在package.json中更改版本)嘿,Galvan,谢谢你的回复。它使用的是0.8.6.Cool版本,如果有帮助,请随意投票支持我的评论:)能否将package.json文件中的“ng2标记输入”“^0.8.5”更改为“ng2标记输入”:“0.8.6”?(在package.json中更改版本)嘿,Galvan,谢谢你的回复。它使用的是0.8.6.Cool版本,如果有帮助,请随意投票支持我的评论:)
npm i ng2-tag-input@0.8.6 --save