// define the controller and inject the relevant constants for that controller (function(angular, undefined) { angular.module('myapp').controller('MyCtrl', MyCtrl) MyCtrl.$inject = ['MyCtrl.API_ENDPOINT', '$http'] function MyCtrl(API_ENDPOINT, $http) { var vm = this vm.doTheThing = doTheThing function doTheThing() { return $http.get(API_ENDPOINT) } } })(angular)