If anything, today was by far the most mind-busting, yet most productive day I had ever gotten with my project. After a lot of readings here and there for what felt like a week, I finally started coding. Because it was over a week long, I seemed to have developed a guilty conscience for NOT coding anything concrete. There were already mornings I would wake up in sweats and with panic.
Today's accomplishments:
- Set a hierarchy for my Firebase - Check!
- Add a task - Check!
- Return list of tasks - Check!
- Load the list of tasks immediately - Check!
- Complete a task - Check!
- Remove a task - ........... brain is gone..........
Of all tasks I accomplished today, I think setting up the hierarchical levels in my Firebase was the most time-consuming because.... One, I was still learning to code in Firebase. And two, I didn't know half of what the hell I was coding in Firebase because the parent-child relationship and dependency injection make my head spins... xC
Here are a short exerpt of my work with Firebase. For those of you who have been developing for yearrrrsss, my code may look UGLY... Or maybe I am doing it all WRONG. But I just learned and coded this today.
SO DON'T JUDGE...... ( >.< )
Today's accomplishments:
- Set a hierarchy for my Firebase - Check!
- Add a task - Check!
- Return list of tasks - Check!
- Load the list of tasks immediately - Check!
- Complete a task - Check!
- Remove a task - ........... brain is gone..........
Of all tasks I accomplished today, I think setting up the hierarchical levels in my Firebase was the most time-consuming because.... One, I was still learning to code in Firebase. And two, I didn't know half of what the hell I was coding in Firebase because the parent-child relationship and dependency injection make my head spins... xC
Here are a short exerpt of my work with Firebase. For those of you who have been developing for yearrrrsss, my code may look UGLY... Or maybe I am doing it all WRONG. But I just learned and coded this today.
SO DON'T JUDGE...... ( >.< )
In my main.js:
// baseRef - starting point "/"
angular.module('planhacker', ['firebase'])
.factory("baseRef", ["$firebase", function($firebase) {
var ref = new Firebase("https://planhacker.firebaseio.com/");
return $firebase(ref);
}])
// userRed - "/users"
.factory("userRef", ["baseRef", "$firebase", function(baseRef, $firebase) {
return baseRef.$child('users');
}])
// user_ID - "/users/user_id"
.factory("user_ID", ["userRef", "$firebase", function(userRef, $firebase) {
return userRef.$child('user_ID');
}])
// taskRef - "/users/user_id/tasks"
.factory("taskRef", ["user_ID", "$firebase", function(user_ID, $firebase) {
return user_ID.$child('tasks');
}])
// taskRef - "/users/user_id/tasks/task_id"
.factory("task_ID", ["taskRef", "$firebase", function(taskRef, $firebase) {
return taskRef.$child('task_ID');
}])
.controller("AddListItemController", ["$scope", "task_ID", function($scope, task_ID) {
$scope.newTask = task_ID;
$scope.addTask = function() {
$scope.newTask = task_ID;
$scope.newTask.$add({name:$scope.inputTask});
};
}])
.controller("RemoveListItemController", ["$scope", "task_ID", function($scope, task_ID) {
$scope.newTask = task_ID;
$scope.removeTask = function(key) {
$scope.newTask = task_ID;
$scope.newTask.$remove(key);
};
}]);
I will continue working on the controller "RemoveListItemController" tomorrow.
My... brain... can't... take.. any... more.... Brain... is... gone.............
I have been coding all day and night. It's 10:58pm and I am still here at Hackbright. Yep, it's time to call it a night and go home.
<3 Kiki
My... brain... can't... take.. any... more.... Brain... is... gone.............
I have been coding all day and night. It's 10:58pm and I am still here at Hackbright. Yep, it's time to call it a night and go home.
<3 Kiki