我已经在角模块中导入了以下行,而且imported.but仍然得到了以下错误错误NG8002:无法绑定到'value‘,因为它不是“ngs-代码编辑器”的一个已知属性。
如果“ngs-代码-编辑器”是一个角度分量,并且它有“值”输入,则验证它是该模块的一部分;如果“ngs-代码编辑器”是组件,则
从“@ng堆栈/代码编辑器”导入{ CodeEditorModule };从“@角/窗体”导入{ FormsModule };
导入: CodeEditorModule.forRoot()、FormsModule、
<ngs-code-editor style="height:90%;width:100%"
theme="vs-light"
[(value)]="code"
language="typescript"
[options]="options"
(valueChanged)="onrqCodeChanged($event)">
</ngs-code-editor>发布于 2021-03-07 06:31:47
发生此错误是因为角无法找到CodeEditorModule。
例如,如果CodeEditorModule.forRoot()是在component.module.ts中导入的,请确保在AppModule中导入ComponentModule。
发布于 2022-11-17 21:29:51
值不再是新版本中的属性。
您必须使用d codeModel代替。
在.html中:
<ngs-code-editor [theme]="theme"
[codeModel]="codeModel"
[options]="options"
(valueChanged)="onCodeChanged($event)">
</ngs-code-editor>在你的.ts里
codeModel: CodeModel = {
language: 'json',
uri: 'main.json',
value: '{}',
};https://stackoverflow.com/questions/66513287
复制相似问题