4

I've installed angular6-json-schema-form. When I use the MaterialDesignFrameworkModule as in the example in documentation it works fine:

import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';

import { MaterialDesignFrameworkModule } from 'angular6-json-schema-form';

import { AppComponent } from './app.component';

@NgModule({
  declarations: [ AppComponent ],
  imports: [
    MaterialDesignFrameworkModule
  ],
  providers: [],
  bootstrap: [ AppComponent ]
})
export class AppModule { }

However, when I use NoFrameworkModule (also described in the documentation), the json-schema-form html element stops working. I get this error:

Uncaught Error: Template parse errors:
Can't bind to 'schema' since it isn't a known property of 'json-schema-form'.
1. If 'json-schema-form' is an Angular component and it has 'schema' input, then verify that it is part of this module.
2. If 'json-schema-form' 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. ("
  <json-schema-form
    loadExternalAssets="true"
    [ERROR ->][schema]="exampleJsonObject"
    framework="no-framework"
    [(ngModel)]="exampleJsonObject">
"): ng:///CatalogModule/DatagridComponent.html@3:4
'json-schema-form' is not a known element:
1. If 'json-schema-form' is an Angular component, then verify that it is part of this module.
2. If 'json-schema-form' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message. ("<p>
  [ERROR ->]<json-schema-form
    loadExternalAssets="true"
    [schema]="exampleJsonObject"

Or, when I delete the [schema] attribute:

Uncaught Error: Template parse errors:
'json-schema-form' is not a known element:
1. If 'json-schema-form' is an Angular component, then verify that it is part of this module.
2. If 'json-schema-form' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message. ("<p>
  [ERROR ->]<json-schema-form
    loadExternalAssets="true"
    framework="no-framework">
"): ng:///CatalogModule/DatagridComponent.html@1:2

How can I solve this problem? I use the package in version 7.1.0.

Hubert Kubiak
  • 607
  • 1
  • 7
  • 30

0 Answers0