Fix to toderp

This commit is contained in:
Max Lynch
2013-09-12 09:53:53 -05:00
parent 39c545699a
commit 107d226ae2
2 changed files with 6 additions and 5 deletions

View File

@ -95,9 +95,9 @@
</form> </form>
<div id="tasks"> <div id="tasks">
<ul class="list"> <ul class="list">
<li class="list-item" ng-repeat="task in tasks"> <li class="list-item" ng-repeat="task in todos">
{{task.text}} {{task.text}}
<input type="checkbox" ng-model="task.completed"> <input type="checkbox" ng-model="task.completed" class="pull-right">
</li> </li>
</ul> </ul>
</div> </div>

View File

@ -87,8 +87,9 @@ angular.module('toderp', ['firebase', 'ngRoute', 'ngAnimate'])
}) })
.controller('TasksCtrl', function($scope, angularFire, FIREBASE_URL) { .controller('TasksCtrl', function($scope, angularFire, FIREBASE_URL) {
var taskRef = new Firebase(FIREBASE_URL + '/tasks'); var taskRef = new Firebase(FIREBASE_URL + '/todos');
$scope.tasks = angularFire(taskRef, $scope, 'tasks'); $scope.todos = [];
angularFire(taskRef, $scope, 'todos');
$scope.addTask = function(task) { $scope.addTask = function(task) {
var t = {}; var t = {};
t = angular.extend({ t = angular.extend({
@ -96,7 +97,7 @@ angular.module('toderp', ['firebase', 'ngRoute', 'ngAnimate'])
}, task); }, task);
console.log("Adding task:", t); console.log("Adding task:", t);
$scope.tasks.push(t); $scope.todos.push(t);
$scope.task = {}; $scope.task = {};
}; };