Skip to content
This repository has been archived by the owner on Sep 4, 2018. It is now read-only.

Can't bind to 'options' since it isn't a known property of 'json-editor'. #13

Open
manuelcugliari opened this issue Jul 13, 2017 · 7 comments

Comments

@manuelcugliari
Copy link

core.es5.js:1084 ERROR Error: Uncaught (in promise): Error: Template parse errors:
Can't bind to 'options' since it isn't a known property of 'json-editor'.

  1. If 'json-editor' is an Angular component and it has 'options' input, then verify that it is part of this module.
  2. If 'json-editor' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message.
  3. To allow any property add 'NO_ERRORS_SCHEMA' to the '@NgModule.schemas' of this component. ("
][options]="editorOptions" [data]="data">
"): ng:///StoreModule/StoreBundleEditorComponent.html@3:19
@thomaspessato
Copy link

thomaspessato commented Aug 3, 2017

Having the same problem here. @manuelcugliari , have you solved this anyhow?

@thomaspessato
Copy link

thomaspessato commented Aug 3, 2017

@manuelcugliari

Considering the following message:

2. If 'json-editor' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message.

I did this:

import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';

and added to 'schemas' on my @NgModule

schemas: [ CUSTOM_ELEMENTS_SCHEMA ],

But then I got another error.

WorkflowDesignerComponent.html:12 ERROR ReferenceError: JSONEditor is not defined
at JSONEditorComponent.webpackJsonp.../../../../ngx-jsoneditor/index.js.JSONEditorComponent.editorInit (index.js:61)
at JSONEditorComponent.webpackJsonp.../../../../ngx-jsoneditor/index.js.JSONEditorComponent.ngAfterViewInit (index.js:34)
at callProviderLifecycles (core.es5.js:11240)
at callElementProvidersLifecycles (core.es5.js:11215)
at callLifecycleHooksChildrenFirst (core.es5.js:11199)
at checkAndUpdateView (core.es5.js:12296)
at callViewAction (core.es5.js:12653)
at execComponentViewsAction (core.es5.js:12585)
at checkAndUpdateView (core.es5.js:12294)
at callViewAction (core.es5.js:12653)

Trying to solve that one now :) One at a time...

@thomaspessato
Copy link

@manuelcugliari

A better aproach:

Install jsoneditor via NPM.

npm install jsoneditor

Install types for jsoneditor

npm i @types/jsoneditor

and then, in your component:

import JSONEditor from 'jsoneditor';

and use it like this:

let jsonEditor = new JSONEditor(container, { mode: 'view' }, json);

Hope this helps. Just got it working.

@vatsalpande
Copy link

@thomaspessato - Can you please share your html code as well? How are you using typings?
Sample code snippet will be helpful

@EmmanuelAmodu
Copy link

EmmanuelAmodu commented Sep 13, 2017

I am having this same issues currently, Is this package still maintained

@Urbansson
Copy link
Owner

@arron21
Copy link

arron21 commented Jul 26, 2018

@manuelcugliari did you import NgJsonEditorModule into your root app.module.ts, and your store.module.ts?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants