Как использовать angular6-json-schema-form с модулем NoFramework, верно? - PullRequest
1 голос
/ 06 марта 2019

Я установил angular6-json-schema-form.Когда я использую MaterialDesignFrameworkModule, как в примере из документации, он работает нормально:

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 { }

Однако, когда я использую NoFrameworkModule (также описано в документации), элемент json-schema-form html перестает работать,Я получаю эту ошибку:

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"

Или, когда я удаляю атрибут [schema]:

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

Как я могу решить эту проблему?Я использую пакет в версии 7.1.0.

...