代码之家  ›  专栏  ›  技术社区  ›  24sharon

角度6输入标记:无法重新声明块范围变量“ngdevmode”。NGX标签输入

  •  1
  • 24sharon  · 技术社区  · 6 年前

    在我的应用程序中,我使用Angular 6。

    我尝试添加 ngx tags input ,但是当我添加到模块文件 (tags input module) i got this error:。

    无法重新声明块范围变量“ngdevmode”。
    节点“模块/NGX标签输入…..
    < /代码> 
    
    

    我试图找到一些解决办法,但对我来说没什么用

    1. 我能解决这个问题吗?
    2. 另一个与Angular 6和Bootstarp支持一起工作的输入标签。.

    .

    Cannot redeclare block-scoped variable 'ngDevMode'.
    node_modules/ngx-tags-input.....
    

    我试图找到一些解决办法,但对我来说没什么用

    1. 我能解决这个问题吗?
    2. 另一个输入标签与Angular6和Bootstarp支持一起工作。

    1 回复  |  直到 6 年前
        1
  •  2
  •   Chellappan வ    6 年前

    此软件包已被弃用并重命名为NGX芯片

    卸载ng标记并安装

    npm i ngx-chips
    

    确保从NGX芯片导入TagInputModule

    import { TagInputModule } from 'ngx-chips';
    import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; // this is needed!
    import { FormsModule, ReactiveFormsModule } from '@angular/forms';
    
    @NgModule({
       imports: [
           TagInputModule, 
           BrowserAnimationsModule,
           FormsModule,
           ReactiveFormsModule
           ...OtherModules 
    
    })
    

    文档: https://www.npmjs.com/package/ngx-chips

    推荐文章