guillotinaweb / ngx-schema-form

HTML form generation based on JSON Schema
MIT License
485 stars 173 forks source link

ng2sf-tinymce not working in Angular 6 #226

Open nolafs opened 6 years ago

nolafs commented 6 years ago

Hi,

I am getting a compile error from ng2sf-tinymce.

ERROR in ./node_modules/ng2sf-tinymce/dist/index.js

Module not found: Error: Can't resolve 'angular2-schema-form'

Any idea why?

Thanks Olaf

ebrehault commented 6 years ago

Unfortunately, ng2sf-tinymce is not upgraded to Angular 6.

nolafs commented 6 years ago

Thanks for letting me know.

Any suggestion or alternatives?

Appreciate the help.

ebrehault commented 6 years ago

I am pretty sure the upgrade is not too difficult to do. Just replacing angular2-schema-form with ngx-schema-form might work directly.

nolafs commented 6 years ago

Ok, thanks

On 24 Jul 2018, at 11:45, Eric BREHAULT notifications@github.com<mailto:notifications@github.com> wrote:

I am pretty sure the upgrade is not too difficult to do. Just replacing angular2-schema-form with ngx-schema-form might work directly.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/makinacorpus/ngx-schema-form/issues/226#issuecomment-407363193, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AIRkE1Oz5oNsKRMbSS7WlTddKtcTKsoEks5uJvrfgaJpZM4VceBs.

nolafs commented 6 years ago

Hi Eric,

I can confirm, that's all you need to do.

Cheers Olaf

ebrehault commented 6 years ago

Excellent! Could you make a pull request?

nolafs commented 6 years ago

I actually notice an issue. The createEditor doesn't init the Tinymce after view init. I was able to fix it by adding setInterval in the createEditor.

this.zone.runOutsideAngular(()=> { this.check = setInterval(()=>{ tinymce.init(options) if(this.editor){ clearInterval(this.check); } },100) });

it feels hacked, any idea why?

ebrehault commented 6 years ago

Well, if ngAfterViewInit is too soon, there is nothing else we can do I guess.

That's pretty surprising though, because the only reason we get an null editor is the target textarea does not existing in the DOM, and I really do not understand why it would not be there at ngAfterViewInit time…