dschnelldavis / angular2-json-schema-form

Angular 2 JSON Schema Form builder
MIT License
285 stars 177 forks source link

Choosing Bootstrap 3 framework still requires import of '@angular/material' #199

Open catull opened 6 years ago

catull commented 6 years ago

Issue type

I'm submitting a: [x] Bug report

Prerequisites

Before posting, make sure you do the following: [X] Confirm you are using the latest versions of all necessary packages (or if not, explain why not) [x] Search GitHub for a similar issue or PR

Current behaviour

import { Bootstrap3FrameworkModule, JsonSchemaFormModule } from 'angular2-json-schema-form';

@NgModule({
 // ......
 imports: [
   // ...
    Bootstrap3FrameworkModule,
    JsonSchemaFormModule.forRoot(Bootstrap3FrameworkModule)
  ],

ng build eventually fails with:

Date: 2018-02-15T11:19:20.035Z
Hash: 14201b7e3fc4afd83b16
Time: 5943ms
chunk {inline} inline.bundle.js, inline.bundle.js.map (inline) 5.83 kB [entry] [rendered]
chunk {main} main.bundle.js, main.bundle.js.map (main) 303 bytes [initial] [rendered]
chunk {polyfills} polyfills.bundle.js, polyfills.bundle.js.map (polyfills) 323 bytes [initial] [rendered]
chunk {scripts} scripts.bundle.js, scripts.bundle.js.map (scripts) 1.67 MB [initial] [rendered]
chunk {styles} styles.bundle.js, styles.bundle.js.map (styles) 463 kB [initial] [rendered]

ERROR in node_modules/angular2-json-schema-form/src/framework-library/material-design-framework/material-design-framework.module.d.ts(2,39): error TS2307: Cannot find module '@angular/material'.

Expected behavior

Hard dependency on @angular/material should be removed.

Environment

macOS: 10.12.6 @angular/cli: 1.6.8 nodeJS: 9.5 angular2-json-schema-form: 0.7.0-alpha.1

SpindlerS commented 6 years ago

I have exactly the same problem.

RobArbor commented 6 years ago

same problem, any work around without installing @angular/material, It kinda bloats up my project.

blacksnow88 commented 6 years ago

I am having the exact issue, as for my project we don't use or require Angular Material, only bootstrap4. It seems like this hard dependency was added on 0.7.0-alpha.1

cipriandrusca commented 6 years ago

Same problem in my case. Did anyone found a solution for it?

catull commented 6 years ago

I have forked the project to catull/ngx-json-schema. It comes without support of Material Design, and is upgraded to Angular 6.0.1.

It is on npmjs.com: ngx-json-schema.