You have syntax errors in how you're injecting the $http dependency into your factory that most likely are breaking the factory code. You are not currently including the factory method within the array where your dependencies are injected. There are also no quotation marks around $http and it's not being injected into the factory correctly (there is no $ symbol when it is passed as a param to the function). It should be:
angular
.module('dataLayerModule', [])
.factory('datalayer', ['$http', function ($http) {
//some method in here that uses http request
return factory;
}]);
Alternative syntax
With the syntax above (including dependencies and the function within an array), it can be difficult to spot these kinds of errors. An alternative and more explicit syntax is to pass the function name into the factory method and declare the function further down.
angular
.module('dataLayerModule', [])
.factory('datalayer', dataLayer);
dataLayer.$inject = ['$http'];
function dataLayer ($http) {
//some method in here that uses http request
return factory;
}