urish / angular-moment

Moment.JS directives for Angular.JS (timeago and more)
MIT License
2.6k stars 397 forks source link

Custom message when there is no value #222

Open niemyjski opened 8 years ago

niemyjski commented 8 years ago

Is there a way to put a default value if the time value is null or undefined. Example if I pass null or 0 as a time interval for time ago. I want to display Never.

medoix commented 8 years ago

Is that not more an angular question? (Sorry just here for a separate issue and saw this).

You can use ng-if / ng-hide / ng-show for examples see this SO https://stackoverflow.com/questions/15810278/if-else-statement-in-angularjs-templates

niemyjski commented 8 years ago

guess I could, but it's kind of a pain to do so, especially when you don't know if the value being parsed by this control is valid or not.