IWI IWI - 1 year ago 91
AngularJS Question

AngularJS and Handlebars limit outputted string length

I am displaying a

with 2 handlebar templates inside and I would like to limit the string length of the first template
to 12 characters. Is there a way to do that? I have seen a way to limit the length on an
as well as when there is only 1 variable output.


<p class="future-appointments-info-holder-text-secondary">
{{person.activeReferralsDate}} | {{person.activeReferralsTime}}

TL;DR - I want
to be limited to 12 characters in output length

Answer Source

You can use limitTo

{{person.activeReferralsDate  | limitTo: 12 }} 


Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download