Skip to content

Instantly share code, notes, and snippets.

Created October 5, 2015 15:03
Show Gist options
  • Save anonymous/dfe7e8d861d616d58363 to your computer and use it in GitHub Desktop.
Save anonymous/dfe7e8d861d616d58363 to your computer and use it in GitHub Desktop.
JS Bin // source http://jsbin.com/tunoge
<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.0/angular.min.js"></script>
<meta charset="utf-8">
<title>JS Bin</title>
</head>
<body>
<script id="jsbin-javascript">
var $injector = angular.injector(['ng']);
var Cities = function($http) {
$http.get("//jsbin.com/xuyis/1.json")
.then(function(response) {
var data = response.data;
console.log('data: ', data);
});
};
Cities.$inject = ['$http'];
$injector.invoke(Cities);
</script>
<script id="jsbin-source-javascript" type="text/javascript">var $injector = angular.injector(['ng']);
var Cities = function($http) {
$http.get("//jsbin.com/xuyis/1.json")
.then(function(response) {
var data = response.data;
console.log('data: ', data);
});
};
Cities.$inject = ['$http'];
$injector.invoke(Cities);</script></body>
</html>
var $injector = angular.injector(['ng']);
var Cities = function($http) {
$http.get("//jsbin.com/xuyis/1.json")
.then(function(response) {
var data = response.data;
console.log('data: ', data);
});
};
Cities.$inject = ['$http'];
$injector.invoke(Cities);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment