formio / angular

JSON powered forms for Angular
https://formio.github.io/angular-demo
MIT License
619 stars 464 forks source link

Unexpected value 'FormioModule' #32

Closed harryhahn closed 7 years ago

harryhahn commented 7 years ago

when use import {FormioModule} from 'ng2-formio' the build process throw an error 'Unexpected value 'FormioModule' imported by the Module 'AppModule'.

When we use import ... from 'ng2-formio/src/index' no error show.

manishkumar-tudip commented 7 years ago

Working on to resolve this issue.

kostenko commented 7 years ago

I have the same issue

SheriefAlaa commented 7 years ago

@manishkumar-tudip is there an ETA for a fix?

Thanks.

travist commented 7 years ago

This should be resolved.

harryhahn commented 7 years ago

when use import {FormioModule} from 'ng2-formio' the build process throw now the error:

ERROR in FormioModule is not an NgModule

Import from src/index works

rmckeel commented 7 years ago

@travist I'm seeing this same issue Uncaught Error: Unexpected value 'FormioModule' imported by the module 'AppModule' presenting in the current tag 1.0.0-rc.1. I have also tried importing from ng2-formio/dist/index, and I get the same issue. Should I open a new issue, or is there some trick to getting it to work now? Thanks!

travist commented 7 years ago

I am releasing a new version tonight with a fix. Thanks for reporting it.

rmckeel commented 7 years ago

@travist Thanks for fixing (I think, I haven't yet gotten it to work). I've had a few hours trying to upgrade my project to NG4 dependencies. Is ng2-formio now reliant on NG4, or is there a way to keep on NG2 (e.g. ng2-formio could work with NG 2.x+ or 4.x)? I'm trying not to upgrade my project just yet as certain packages like angularfire2 are still at 'rc0' stage and require code updates.

travist commented 7 years ago

This should work for both Angular 2 or Angular 4. I wasn't sure how to make the package.json allow for either one, so let me know if you know of a way to do that. I have tested it in both Angular 2 and Angular 4 and it works for both.

rmckeel commented 7 years ago

I see in https://docs.npmjs.com/files/package.json, you can use the "||" operator, e.g. range1 || range2. I have seen this before for Angular, but I can't find a good example off the cuff.