Angular6 json schema form loads Bootstrap module

1.1k views Asked by At

I'm using angular6-json-schema-form in Angular v6 project. I installed it with command:

$ yarn add angular6-json-schema-form

I imported Bootstrap4FrameworkModule like this:

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

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

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

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

And my component is like the following:

<json-schema-form
loadExternalAssets="true"
[schema]="schema"
(onSubmit)="submit($event)">
</json-schema-form>

The generated forms works fine but the Bootstrap4 styling doesn't work. I have no styling only plain html.

1

There are 1 answers

0
Melchia On BEST ANSWER

Never mind I found the solution in Documentation. I need to specify the template/framwork in the component HTML:

<json-schema-form
loadExternalAssets="true"
[schema]="schema"
framework="bootstrap-4"
(onSubmit)="submit($event)">
</json-schema-form>