aboutsummaryrefslogtreecommitdiffstats
path: root/public/scripts
diff options
context:
space:
mode:
authorEvan Chiu2014-10-30 22:52:30 -0400
committerEvan Chiu2014-10-30 22:52:30 -0400
commit496b780ee2f9af613e3f3b92f86c369d654a6b48 (patch)
tree070be919697dc2848b62770c2e5797c56ca50523 /public/scripts
parent60de545f54eda6c9ce20d78030940bfaa1a34c40 (diff)
downloadsipping-point-496b780ee2f9af613e3f3b92f86c369d654a6b48.tar.bz2
Adding style, friends
Diffstat (limited to 'public/scripts')
-rw-r--r--public/scripts/app.js29
-rw-r--r--public/scripts/controllers.js39
2 files changed, 68 insertions, 0 deletions
diff --git a/public/scripts/app.js b/public/scripts/app.js
new file mode 100644
index 0000000..de47a22
--- /dev/null
+++ b/public/scripts/app.js
@@ -0,0 +1,29 @@
+'use strict';
+
+
+// Declare app level module which depends on filters, and services
+angular.module('app', [
+ 'ngRoute',
+ 'app.controllers'
+])
+ .config(['$routeProvider', function($routeProvider) {
+ $routeProvider
+ .when('/', {
+ templateUrl: 'partials/login.html',
+ controller: 'loginController'
+ })
+ .when('/home', {
+ templateUrl: 'partials/home.html',
+ controller: 'homeController'
+ })
+ .when('/new-event', {
+ templateUrl: 'partials/new.html',
+ controller: 'newController'
+ })
+ .when('/event', {
+ templateUrl: 'partials/event.html',
+ controller: 'eventController'
+ }).otherwise({
+ redirectTo: '/'
+ });
+ }]);
diff --git a/public/scripts/controllers.js b/public/scripts/controllers.js
new file mode 100644
index 0000000..048853e
--- /dev/null
+++ b/public/scripts/controllers.js
@@ -0,0 +1,39 @@
+'use strict';
+
+/* Controllers */
+
+angular.module('app.controllers', [])
+ .controller('loginController',
+ ['$scope', '$routeParams', '$http',
+ function($scope, $routeParams, $http) {
+ $scope.title='Login'
+ }])
+ .controller('homeController',
+ ['$scope', '$routeParams', '$http',
+ function($scope, $routeParams, $http) {
+ $scope.title='Home'
+ }])
+ .controller('newController',
+ ['$scope', '$routeParams', '$http',
+ function($scope, $routeParams, $http) {
+ $scope.title='New Event'
+
+ window.setTimeout(function(){
+ console.log('calling');
+ $http.get('https://graph.facebook.com/v2.2/'
+ + AUTH.userID + '/friends?access_token='
+ + AUTH.accessToken
+ + '&format=json&method=get&pretty=0&suppress_http_code=1')
+ .success(
+ function(data) {
+ console.log(data);
+ $scope.friends = data.data;
+ }
+ );
+ }, 3000);
+ }])
+ .controller('eventController',
+ ['$scope', '$routeParams', '$http',
+ function($scope, $routeParams, $http) {
+ $scope.title='Event'
+ }])