Search Posts

Category: trim

Override angularJS trim in div

I’m currently working on a ticket where I need to add a @Tag at the start of a div, using ng-model property. I’m required to add a space after the @Tag, so that users can start typing right away. Tag trimmed example However, I found that ng-model trims the whitespace as long as I don’t add some other character after, and that ng-trim doesn’t work on div. The code is too complex to change the […]

How to trim and concatenate strings in AngularJS

I want an event which currently has its starting date and ending date in a list as: Event1={Start: ‘Sep 18, 2017 10:00AM’, End: ‘Sep 18, 2017 11:00AM’} How can I trim and concatenate this to just display Event1 as Sep 18, 2017, 10:00 AM – 11:00 AM as my event start and end dates would always be the same so I don’t need them to displayed separately. I could do them both in my controller […]