lentschi / ngx-ellipsis

Multiline text with ellipsis for angular 9+
MIT License
96 stars 22 forks source link

Content is not displayed if it's equal to 0. #26

Closed alifshits closed 5 years ago

alifshits commented 5 years ago

Hello!

If you bind ellipsis-content to an integer property which has value equal to 0, it won't be displayed. Here is a stackblitz reproducing it: https://stackblitz.com/edit/angular-1smu3f-znwynp?file=app/ellipsis-example.ts

I believe the issue is here: https://github.com/lentschi/ngx-ellipsis/blob/4dd031c61a6ceb1c263e4f96b665eabb4062af93/projects/ngx-ellipsis/src/lib/directives/ellipsis.directive.ts#L178 if (0) -> false

The issue wouldn't happen if ellipsis directive made unconditional toString call for ellipsisContent property.

What do you think?

Thanks.

lentschi commented 5 years ago

@Alexander8 You're right - thanks for reporting this in such detail!

Fixed in ngx-ellipsis@2.0.7.

alifshits commented 5 years ago

Thank you, @lentschi!