Reputation: 87
I have imported the following lines in angular module and also imported.but still getting following error error NG8002: Can't bind to 'value' since it isn't a known property of 'ngs-code-editor'.
import { CodeEditorModule } from '@ngstack/code-editor'; import { FormsModule } from "@angular/forms";
imports: [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>
Upvotes: 3
Views: 1629
Reputation: 465
value is no longer an attribute in the new version.
You have to use d codeModel instead.
<ngs-code-editor [theme]="theme"
[codeModel]="codeModel"
[options]="options"
(valueChanged)="onCodeChanged($event)">
</ngs-code-editor>
codeModel: CodeModel = {
language: 'json',
uri: 'main.json',
value: '{}',
};
Upvotes: 0
Reputation: 409
This error occurred because Angular couldn't find the CodeEditorModule
.
For example, if the CodeEditorModule.forRoot()
is imported in your component.module.ts
, make sure you import ComponentModule
within your AppModule
.
Upvotes: 1