mirror of
https://github.com/arnaucube/thoughts.git
synced 2026-02-07 03:36:49 +01:00
database externa
This commit is contained in:
@@ -8,18 +8,14 @@ angular.module('thoughtsApp', [])
|
||||
) {
|
||||
|
||||
var thoughtsList = this;
|
||||
|
||||
if(window.sessionStorage.getItem('thoughtsToken'))
|
||||
{
|
||||
$scope.userLogged=true;
|
||||
}else{
|
||||
$scope.userLogged=false;
|
||||
}
|
||||
|
||||
$scope.availableAvatars=[
|
||||
"img/icons/animals/cat.png",
|
||||
"img/icons/animals/crab.png",
|
||||
"img/icons/animals/toucan.png"
|
||||
];
|
||||
}
|
||||
$http({
|
||||
method : "GET",
|
||||
url : url + "thoughts"
|
||||
@@ -29,6 +25,24 @@ angular.module('thoughtsApp', [])
|
||||
$scope.myWelcome = response.statusText;
|
||||
});
|
||||
|
||||
$scope.availableAvatars=[
|
||||
"img/icons/animals/cat.png",
|
||||
"img/icons/animals/crab.png",
|
||||
"img/icons/animals/toucan.png"
|
||||
];
|
||||
|
||||
$scope.getAllThoughts = function(){
|
||||
$http({
|
||||
method : "GET",
|
||||
url : url + "thoughts"
|
||||
}).then(function mySucces(response) {
|
||||
thoughtsList.thoughts = response.data;
|
||||
}, function myError(response) {
|
||||
$scope.myWelcome = response.statusText;
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
|
||||
thoughtsList.addTodo = function() {
|
||||
todoList.todos.push({text:todoList.todoText, done:false});
|
||||
@@ -45,6 +59,7 @@ angular.module('thoughtsApp', [])
|
||||
mail: $scope.mail,
|
||||
avatar: $scope.avatar
|
||||
};
|
||||
console.log(obj);
|
||||
$http({
|
||||
method : "POST",
|
||||
url : url + "users",
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
|
||||
<ul class='right' ng-hide="!userLogged">
|
||||
|
||||
<li><a ng-click='getAllThoughts()'><i class='material-icons'>play_for_work</i></a></li>
|
||||
<li><a href='newthought.html'><i class='material-icons'>add</i></a></li>
|
||||
<li><a class="dropdown-button" href="#!" data-activates="dropdown1"><i class='material-icons'>perm_identity</i></a></li>
|
||||
|
||||
|
||||
@@ -44,13 +44,13 @@
|
||||
<label for="mail">Mail</label>
|
||||
</div>
|
||||
<div class="input-field col s6">
|
||||
<input ng-model="avatar" id="avatar" type="email" class="validate">
|
||||
<input ng-model="avatar" id="avatar" type="text" class="validate">
|
||||
<label for="avatar">Avatar</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<a href="index.html" class="waves-effect waves-light btn red lighten-2 ">Cancel</a>
|
||||
<a ng-click="signin()" class="waves-effect waves-light btn indigo lighten-2 right">Login</a>
|
||||
<a ng-click="signin()" class="waves-effect waves-light btn indigo lighten-2 right">Signin</a>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user