mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-11-06 22:29:44 +08:00
Action sheet delete
This commit is contained in:
@ -67,7 +67,7 @@ angular.module('ionic.todo.controllers', ['ionic.todo'])
|
||||
|
||||
|
||||
// The tasks controller (main app controller)
|
||||
.controller('TasksCtrl', function($scope, angularFire, angularFireCollection, Modal, FIREBASE_URL) {
|
||||
.controller('TasksCtrl', function($scope, angularFire, angularFireCollection, Modal, ActionSheet, FIREBASE_URL) {
|
||||
/*
|
||||
var lastProjectRef = new Firebase(FIREBASE_URL + '/lastproject');
|
||||
var lastProjectPromise = angularFire(lastProjectRef, $scope, 'lastProject');
|
||||
@ -163,6 +163,26 @@ angular.module('ionic.todo.controllers', ['ionic.todo'])
|
||||
$scope.sideMenuCtrl.close();
|
||||
};
|
||||
|
||||
$scope.deleteProject = function(project) {
|
||||
var ref = project;
|
||||
|
||||
ActionSheet.show({
|
||||
buttons: [],
|
||||
destructiveText: 'Delete Project',
|
||||
cancelText: 'Cancel',
|
||||
cancel: function() {
|
||||
return true;
|
||||
},
|
||||
destructiveButtonClicked: function() {
|
||||
if(project.$ref) {
|
||||
ref = project.$ref;
|
||||
}
|
||||
ref.remove();
|
||||
return true;
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
var projectsRef = new Firebase(FIREBASE_URL + '/project_list');
|
||||
$scope.projects = angularFireCollection(projectsRef.limit(100), function(snapshot) {
|
||||
if(!snapshot.val()) {
|
||||
|
||||
Reference in New Issue
Block a user