Use a Custom Service Inside a Filter
Once we created a service, and connected it to our application,
we use the service in any controller, directive, filter, or even inside other services.
To use the service inside a filter, add it as a dependency when defining the filter:
To create your own service, connect your service to the module:
let's understand with an example
A custom service with a method: