-
Notifications
You must be signed in to change notification settings - Fork 1
/
script.js
executable file
·38 lines (25 loc) · 1.06 KB
/
script.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
var app=angular.module('single-page-app',['ngRoute', 'picardy.fontawesome']);
app.config(function($routeProvider){
$routeProvider
.when('/',{
templateUrl: 'sector.html'
})
.when('/sector/:sector_name',{
templateUrl: 'sector.html'
});
});
app.controller('cfgController',function($scope){
$scope.message="Hello world";
});
app.controller('sectorController',['$scope', '$routeParams', '$http', function($scope, $routeParams, $http){
$http.get('http://transparencydata.com/api/1.0/aggregates/pol/4148b26f6f1c437cb50ea9ca4699417a/contributors/industries.json?cycle=2012&limit=20&apikey=390dd7fa73c94cb483d53e671a6ee216').
success(function(data, status, headers, config) {
console.log(data);
// this callback will be called asynchronously
// when the response is available
}).
error(function(data, status, headers, config) {
// called asynchronously if an error occurs
// or server returns response with an error status.
});
}]);