forked from utahpython/utahpython.github.com
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcontroller.js
More file actions
55 lines (47 loc) · 1.57 KB
/
controller.js
File metadata and controls
55 lines (47 loc) · 1.57 KB
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
'use strict';
angular.module('utahPython', ['ui.router', 'ngSanitize'])
.config(function($stateProvider, $urlRouterProvider){
$urlRouterProvider.otherwise("/");
$stateProvider
.state('home', {
url: "/"
})
.state('about', {
url: "/about",
templateUrl: "about.html"
})
.state('locations', {
url: "/locations",
templateUrl: "locations.html"
})
.state('past_present', {
url: "/presentations",
templateUrl: "presentations.html"
})
.state('license', {
url: "/license",
templateUrl: "license.html"
});
})
.controller('MeetupCtrl', function($http) {
var meetup = this;
// The signed url shouldn't contains any provate key information
// It's created by using the meetup js api features
meetup.signed_url = meetup_signed_url;
// Required for JSON callbacks
meetup.signed_url = meetup.signed_url + "&callback=JSON_CALLBACK"
meetup.events = [];
meetup.loadMeetups = function loadMeetups() {
$http.jsonp(meetup.signed_url)
.then(function success(result) {
// console.log(result.data.results);
meetup.events = result.data.results;
for (var i = meetup.events.length - 1; i >= 0; i--) {
meetup.events[i]['gmap_url'] = "https://maps.google.com/maps?q="+meetup.events[i]['venue']['lat']+","+meetup.events[i]['venue']['lon']+"&hl=es;z=14&output=embed";
};
}, function error(error) {
console.log(error);
});
};
meetup.loadMeetups();
});