mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
More controller work
This commit is contained in:
@@ -30,7 +30,7 @@
|
||||
#splash-view .ionic-logo {
|
||||
}
|
||||
|
||||
#splash-view, #signup-view, #login-view {
|
||||
#splash-view, #signup-view {
|
||||
background: url('../img/splash.png') no-repeat transparent;
|
||||
background-size: cover;
|
||||
}
|
||||
|
||||
@@ -97,7 +97,7 @@ angular.module('ionic.todo.controllers', ['ionic.todo'])
|
||||
$scope.addTask = function(task) {
|
||||
var t = {};
|
||||
t = angular.extend({
|
||||
id: $scope.user.id
|
||||
id: $scope.user.id
|
||||
}, task);
|
||||
|
||||
console.log("Adding task:", t);
|
||||
@@ -124,9 +124,22 @@ angular.module('ionic.todo.controllers', ['ionic.todo'])
|
||||
|
||||
console.log("Adding project:", p);
|
||||
|
||||
$scope.projects.push(t);
|
||||
$scope.projects.push(p);
|
||||
|
||||
$scope.task = {};
|
||||
// Reset the form
|
||||
$scope.newProject = {};
|
||||
};
|
||||
|
||||
// Check if we need to create an initial list
|
||||
taskRef.on('value', function(snapshot) {
|
||||
if(!snapshot.val()) {
|
||||
var title = prompt('Create your first list:');
|
||||
if(title) {
|
||||
$scope.addProject({
|
||||
title: title
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user