简体   繁体   English

无法绑定到“主题”,因为它不是“ jqxTree”的已知属性

[英]Can't bind to 'theme' since it isn't a known property of 'jqxTree'

I am using jqxTreeComponent in angular 7 after running below code and cofiguring some setting i am getting this error when doing ng serve. 我在下面的代码中运行并配置一些设置后在角度7中使用jqxTreeComponent,在执行ng服务时遇到此错误。

npm install jqwidgets-scripts --save

I am getting this error when doing ng serve. 执行ng服务时出现此错误。 在此处输入图片说明 this is my compoenent template code : 这是我的组件模板代码:

 <div class="tree-container">
          <jqxTree class="tree-container--item" [theme]="'material'" #myTree [width]="300" [height]="450" [source]="records"
            [rtl]="true">
          </jqxTree>
          <div class="tree-container--item">
            <div fxLayout="row">
              <jqxButton [theme]="'material'" (onClick)="AddNode($event)" [width]="125" [height]="25">add</jqxButton>
              <input [(ngModel)]="nodeName"  *ngIf="showTextBox" placeholder="add" />
            </div>
</div>

in addition i added below code in ts file of my component (of course in right place!!) 另外,我在组件的ts文件中添加了以下代码(当然在正确的位置!)

import { jqxTreeComponent } from 'jqwidgets-scripts/jqwidgets-ts/angular_jqxtree';
@ViewChild('myTree') myTree: jqxTreeComponent;

beside this step i added two component in decleration section in app.module.ts file: 在这一步旁边,我在app.module.ts文件的decleration部分添加了两个组件:

import { jqxButtonComponent } from 'jqwidgets-scripts/jqwidgets-ts/angular_jqxbuttons';
import { jqxTreeComponent } from 'jqwidgets-scripts/jqwidgets-ts/angular_jqxtree';


  jqxButtonComponent, jqxTreeComponent

and as final step i added below code to my tscodfig file: 最后一步,我在tscodfig文件中添加了以下代码:

 "include": [
        "src/**/*"
    ],
    "files": [
        "src/app/app.module.ts",
        "node_modules/jqwidgets-scripts/jqwidgets-ts/angular_jqxbuttons.ts",
        "node_modules/jqwidgets-scripts/jqwidgets-ts/angular_jqxtree.ts"
    ]

Everything seems to be right now i want to know what is the problem??!!! 现在一切似乎都正确了,我想知道出什么问题了?

I have few suggestions please try, hope it helps 我没有什么建议,请尝试,希望对您有所帮助

  1. Make a JqxWidgetsModule 制作一个JqxWidgetsModule

    import { jqxButtonComponent } from 'jqwidgets-scripts/jqwidgets-ts/angular_jqxbuttons'; 从'jqwidgets-scripts / jqwidgets-ts / angular_jqxbuttons'导入{jqxButtonComponent};
    import { jqxTreeComponent } from 'jqwidgets-scripts/jqwidgets-ts/angular_jqxtree'; 从'jqwidgets-scripts / jqwidgets-ts / angular_jqxtree'导入{jqxTreeComponent};

    @NgModule({ @NgModule({
    declarations: [ jqxButtonComponent, jqxTreeComponent], 声明:[jqxButtonComponent,jqxTreeComponent],
    exports: [ jqxButtonComponent, jqxTreeComponent] 导出:[jqxButtonComponent,jqxTreeComponent]
    }) })
    export class JqxWidgetsModule { } 导出类JqxWidgetsModule {}

Import this module in your LocationModule 将此模块导入您的LocationModule中

    @NgModule({
  declarations: [...],
  imports: [
    CommonModule,
    LocationRoutingModule,
    JqxWidgetsModule
  ]
})
export class LocationModule { }
  1. In tsconfig.json file after compilerOptions property add the below config: 在编译器选项属性之后的tsconfig.json文件中,添加以下配置:

    "include": [ "src/**/*.ts", "node_modules/jqwidgets-scripts/jqwidgets-ts/angular_jqxbuttons.ts", "node_modules/jqwidgets-scripts/jqwidgets-ts/angular_jqxtree.ts" ]

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 无法绑定到&#39;property&#39;,因为它不是&#39;cmp&#39;的已知属性 - Can't bind to 'property' since it isn't a known property of 'cmp' 无法绑定到“属性”,因为它不是“组件”的已知属性 - Can't bind to 'property' since it isn't a known property of 'component' 无法绑定到属性,因为它不是组件的已知属性 - Can't bind to property since it isn't a known property of a component 无法绑定到属性,因为它不是元素的已知属性 - Can't bind to property since it isn't a known property of element 角度-无法绑定到“属性”,因为它不是“ a”的已知属性 - Angular - Can't bind to 'property' since it isn't a known property of 'a' 无法绑定到“禁用”,因为它不是“li”的已知属性 - Can't bind to 'disabled' since it isn't a known property of 'li' EventEmitter - 无法绑定,因为它不是已知属性 - Angular 8 - EventEmitter - Can't bind since it isn't a known property - Angular 8 无法绑定到“ cacheSrc”,因为它不是“ img”的已知属性 - Can't bind to 'cacheSrc' since it isn't a known property of 'img' 无法绑定到“ startingCategory”,因为它不是“ div”的已知属性 - Can't bind to 'startingCategory' since it isn't a known property of 'div' 无法绑定到“ FormGroup”,因为它不是“ form”的已知属性。 (” - Can't bind to 'FormGroup' since it isn't a known property of 'form'. ("
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM