I want to forget "jQuery" because i like "AngularJS". However, i need to know how to use independent tasks that incorporate AngularJS elsewhere in my application. On this occasion I want to use "$https AngularJS" function to import a JavaScript file for example.
Example (it used to do in jQuery):
$.get("url.js", function(data){ eval(data) }); //ok
console.info($.get); //code code code... ok
Example (as documented in AngularJS)
//In a controller
App.controller('Ctrllr', ['$http', function ($http) {
$http.get("url.js").success(function(data){
eval(data); //ok
});
console.info($http); //code code code.... ok
})
//outside
$http.get("url.js"); //$http is undefined
//How to use $http here?
As you see in the last call, $http is outside of a process. Now, would like to know, how to use the class $http or another Angular utils outside of a controller/application?