-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.js
27 lines (22 loc) · 768 Bytes
/
app.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
angular.module('activenetupcomingCoursesForTeachers', []).
controller('MainController', ['$scope', '$http', '$sce', function($scope, $http, $sce) {
$scope.courses = [];
$scope.error = '';
var url = 'http://api.amp.active.com/v2/search';
url = $sce.trustAsResourceUrl(url);
$http.jsonp(url, {
jsonpCallbackParam: 'cb',
params:{
query:'A1.1',
org_id:'6b1423e1-84b8-4d92-8857-65860e5ace46',
city:'Toronto',
start_date:'2017-02-26..2017-04-30',
api_key:'xshzx6dy2mgrghnruj46t9fz'
}}).
then(function(data){
console.log(data);
}).catch(function(err){
console.log(err);
$scope.error = JSON.stringify(err);
});
}]);