-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
went through all of code, completed authorization, login, registering…
… and creating and editing boards
- Loading branch information
Showing
10 changed files
with
137 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,14 @@ | ||
"use strict"; | ||
|
||
app.controller("CreateBoardCtrl", function($scope, $rootScope, $location, BoardFactory){ | ||
$scope.newBoard = {}; | ||
$scope.newPin = {}; | ||
|
||
$scope.addNewBoard = function(){ | ||
$scope.newBoard.isClicked = true; | ||
$scope.newPin.isSelected = false; | ||
$scope.newBoard.uid = $rootScope.user.uid; | ||
BoardFactory.postNewBoard($scope.newBoard).then(function(BoardId){ | ||
BoardFactory.postNewBoard($scope.newPin).then(function(boardId){ | ||
$location.url("/boards/list"); | ||
$scope.newBoard = {}; | ||
$scope.newPin = {}; | ||
}); | ||
}; | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
"use strict"; | ||
app.factory("UserFactory", function($q, $http, FIREBASE_CONFIG){ | ||
let addUser = (authData) => { | ||
return $q((resolve, reject) => { | ||
$http.post(`${FIREBASE_CONFIG.databaseURL}/users.json`, JSON.stringify({ | ||
uid: authData.uid, | ||
username: authData.username | ||
}) | ||
) | ||
.success(function(storeUserSuccess){ | ||
resolve(storeUserSuccess); | ||
}) | ||
.error(function(storeUserError){ | ||
reject(storeUserError); | ||
}); | ||
}); | ||
}; | ||
|
||
let getUser = (userId) =>{ | ||
return $q((resolve, reject) => { | ||
$http.get(`${FIREBASE_CONFIG.databaseURL}/users.json?orderBy="uid"&equalTo="${userId}"`) | ||
.success(function(userObject){ | ||
let users = []; | ||
Object.keys(userObject).forEach(function(key){ | ||
users.push(userObject[key]); | ||
}); | ||
resolve(users[0]); | ||
}) | ||
.error(function(error){ | ||
reject(error); | ||
}); | ||
}); | ||
|
||
}; | ||
|
||
return {addUser:addUser, getUser:getUser}; | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
<div class="container col-xs-4 col-xs-offset-3"> | ||
<div class="row"> | ||
<button class="btn btn-success col-xs-6" ng-click="setRegisterContainer()">Register</button> | ||
<button class="btn btn-info col-xs-6" ng-click="setLoginContainer()">Login</button> | ||
|
||
</div> | ||
<div class="row"> | ||
|
||
<!-- start of register form --> | ||
<form ng-show="loginContainer"> | ||
|
||
<div class="form-group"> | ||
<label>Email Address</label> | ||
<input type="email" class="col-xs-offset-1 col-xs-10" placeholder="Email address" ng-model="login.email" required autofocus> | ||
</div> | ||
|
||
<div class="form-group"> | ||
<label>Password</label> | ||
<input type="password" class="col-xs-offset-1 col-xs-10" placeholder="" ng-model="login.password" required> | ||
</div> | ||
|
||
<div class="form-group"> | ||
<a class="btn btn-lg btn-success col-xs-offset-1 col-xs-10" ng-click="loginUser(login)">Submit Login</a> | ||
</div> | ||
|
||
</form> | ||
<!--end of register form --> | ||
|
||
<!-- start of login form --> | ||
<form ng-show="registerContainer"> | ||
|
||
<div class="form-group"> | ||
<label>Email Address</label> | ||
<input type="email" class="col-xs-offset-1 col-xs-10" placeholder="Email address" ng-model="register.email" required autofocus> | ||
</div> | ||
|
||
<div class="form-group"> | ||
<label>Password</label> | ||
<input type="password" class="col-xs-offset-1 col-xs-10" placeholder="" ng-model="register.password" required> | ||
</div> | ||
|
||
<div class="form-group"> | ||
<label>Username</label> | ||
<input type="text" class="col-xs-offset-1 col-xs-10" placeholder="Username" ng-model="register.username" required> | ||
</div> | ||
|
||
<div class="form-group"> | ||
<a class="btn btn-lg btn-success col-xs-offset-1 col-xs-10" ng-click="registerUser(register)">Submit Registration</a> | ||
</div> | ||
|
||
</form> | ||
<!-- end of login form --> | ||
|
||
</div> | ||
</div> |
This file was deleted.
Oops, something went wrong.