As we've seen, the
limitTo filter is great for truncating strings of text. I've always felt that the filter could do with appending an ellipsis should the string cross the limit. Thankfully, Angular lets us expand upon the included filters and build our own.
In order to create our filter, we first need to create what's called a module. This will enable us to attach a filter and utilize it in our views or controllers. I think the AngularJS documentation explains what a module is perfectly:
"You can think of a module as a container for the different parts of your app: controllers, services, filters, directives, and so on."
Okay great, but why would we or do we need to use one? There are a couple of reasons why you might ...