...in a separate AngularJS service or child controller, so that it can be re-used (and hopefully make the code more readable)
...in a separate AngularJS service or child controller, so that it can be re-used (and hopefully make the code more readable)