I need to write an angular module that uses $http
(function () {
'use strict';
var app = angular.module('myModule', []);
app.provider("$late", function () {
var file;
var remoteFile
var data = {};
var separator;
return ({
$get: instantiateLate,
Load: Load
});
function Load(config) {
console.log("load");
this.file = (config.file !== undefined) ? config.file : "";
this.remoteFile = (config.remoteFile !== undefined) ? config.remoteFile : "";
this.separator = (config.separator !== undefined) ? config.separator : ".";
if (this.remoteFile === undefined && this.remoteFile === undefined)
throw new Error('Specificare un file locale o remoto');
//$http.get ....
}
function instantiateLate() {
return ({
file: file,
remoteFile: remoteFile,
data: data,
separator: separator
});
}
});
}());
How can I use the $http? When I uncomment $http.get I get this error:
ReferenceError: $http is not defined
thanks