Question from the AngularJS test

Where should I put a function that is used in multiple components in AngularJS?