database externa

This commit is contained in:
nau
2016-08-23 18:11:51 +02:00
parent 8a6f3bf221
commit 5fa880dd01
616 changed files with 101532 additions and 43773 deletions

View File

@@ -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",

View File

@@ -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>

View File

@@ -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>