martinsvb / ng2-summernote

Angula 2.0 summernote wysiwyg editor integration
14 stars 12 forks source link

Summernote not showing #6

Open elmartino opened 7 years ago

elmartino commented 7 years ago

Hi,

I followed the readme, got no errors, but summernote is not showing up. Only thing created is an empty <div class="summernote"></div> inside the <ng2-summernote>.

Any ideas? Thanks!

jeetenparmar commented 7 years ago

Did you get any solution ?

elmartino commented 7 years ago

Nope unfortunately not. I used the non angular2 version of summernote for the time being..

jeetenparmar commented 7 years ago

which one ? Can you give me any example ?

tewson commented 7 years ago

Hi, I assume you initialised the ngModel attribute of the ng2-summernote component with an empty string (i.e. '')?

If that's the case, it seems like the condition on this line treats the empty string as a falsy value so the editor is not rendered.

A workaround for this is initialising the ngModel attribute of the ng2-summernote component with a truthy empty string by using new String('') instead of just ''.

Hope this helps.

kakalos12 commented 7 years ago

@martinsvb Do you have any plans to update this ?

segvan commented 6 years ago

yes there is a bug in writeValue(value: any) method. Instead of if (value) { ... } should be if (value !== 'undefined' && value !== null) { ... }

martinsvb commented 6 years ago

I think you can kindly use if (!!value) {} But, I didn't support this package. Can somebody make PR?

Thank you

segvan commented 6 years ago

No (!!value) will not work because empty string will still give false. I will do PR with pleasure.