(function (angular) { 'use strict'; angular .module('app') .factory('myFactory', myFactory); myFactory.$inject = ['$http']; function myFactory ($http) { var service = { getData: getData }; return service; function getData() { } } })(window.angular);