diff --git a/controller.js b/controller.js index 15d9e35..260d553 100644 --- a/controller.js +++ b/controller.js @@ -1,4 +1,6 @@ -var app = angular.module('flashy.controller', ['ui.router']); +var app = angular.module('flashy.controller', ['ui.router']).config(function ($locationProvider) { + $locationProvider.html5Mode(true); +}); app.controller('HomeController', ['$scope', '$state', function ($scope, $state) { @@ -6,9 +8,14 @@ app.controller('HomeController', ['$scope', '$state', function ($scope, $state) // SIGN UP $scope.signUp = function (email, username, password) { - // make server call console.log('go to dashboard'); + $.post('https://flashy.cards/api/users/me', + {"email": email, "password": password}, + function (data, textStatus, jqXHR) { + console.log(data); + } + ); // if successful, go to dashboard $state.go('dashboard'); @@ -17,28 +24,30 @@ app.controller('HomeController', ['$scope', '$state', function ($scope, $state) // LOGIN - $scope.login = function (emailOrUsername, password) { - - console.log('LOGGING IN'); - - // make server call + $scope.login = function (email, password) { + console.log('go to dashboard'); + $.post('https://flashy.cards/api/login', + {"email": email, "password": password}, + function (data, textStatus, jqXHR) { + console.log(data); + } + ); - // if successful, go to dashboard + $state.go('dashboard'); }; - -}]) +}]); app.controller("DashboardController", function () { - - alert("HEYYYYYY"); + // This gets really annoying every time I refresh the page :( + //alert("HEYYYYYY"); -}) +}); diff --git a/home.html b/home.html index f3c55d5..fe689e3 100644 --- a/home.html +++ b/home.html @@ -1,86 +1,85 @@ - - - - - + + + + + - - - + -
-

Create and share flashcards in real time!

-
+ + + +
+

Create and share flashcards in real time!

+

The System shall enlighten you.

SWAG -
+
+
+ +
+ +
+
-
- -
- + +
+ +
+
+
+ +
+ +
+ +
+ +
- - -
- -
-
-
- -
- -
- -
- -
- -
- -
-
- - -
-
-
- -
-
- -
- -
-
+ + +
+
+
+ +
+
+ +
+ +
+
+ + + + + - - - - - - - + + - + diff --git a/templates/dashboard.html b/templates/dashboard.html index 703387d..70d9971 100644 --- a/templates/dashboard.html +++ b/templates/dashboard.html @@ -1,17 +1,5 @@ - - - - - - - - - - - - - Add a class lol - - + \ No newline at end of file diff --git a/templates/feed.html b/templates/feed.html index 71ce692..114f04d 100644 --- a/templates/feed.html +++ b/templates/feed.html @@ -1,10 +1,17 @@ - - - - - - - - \ No newline at end of file + + + + + + + + + + + Add a class lol + +