mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-11-07 23:16:52 +08:00
Fix to toderp
This commit is contained in:
@ -95,9 +95,9 @@
|
||||
</form>
|
||||
<div id="tasks">
|
||||
<ul class="list">
|
||||
<li class="list-item" ng-repeat="task in tasks">
|
||||
<li class="list-item" ng-repeat="task in todos">
|
||||
{{task.text}}
|
||||
<input type="checkbox" ng-model="task.completed">
|
||||
<input type="checkbox" ng-model="task.completed" class="pull-right">
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
@ -87,8 +87,9 @@ angular.module('toderp', ['firebase', 'ngRoute', 'ngAnimate'])
|
||||
})
|
||||
|
||||
.controller('TasksCtrl', function($scope, angularFire, FIREBASE_URL) {
|
||||
var taskRef = new Firebase(FIREBASE_URL + '/tasks');
|
||||
$scope.tasks = angularFire(taskRef, $scope, 'tasks');
|
||||
var taskRef = new Firebase(FIREBASE_URL + '/todos');
|
||||
$scope.todos = [];
|
||||
angularFire(taskRef, $scope, 'todos');
|
||||
$scope.addTask = function(task) {
|
||||
var t = {};
|
||||
t = angular.extend({
|
||||
@ -96,7 +97,7 @@ angular.module('toderp', ['firebase', 'ngRoute', 'ngAnimate'])
|
||||
}, task);
|
||||
|
||||
console.log("Adding task:", t);
|
||||
$scope.tasks.push(t);
|
||||
$scope.todos.push(t);
|
||||
|
||||
$scope.task = {};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user