angularjs - Using Angularfire to remove todo items from two templates in order be placed in another and updating Firebase DB -


In this question I have not even thought of angled filter or anything else. I'm having trouble removing my Todo item from a template and when a date has expired in my Todo list, I am using the AngleFire for the database.

I now have a todo list that asks for some 'todo' and completion date if user has not completed in 7 days, Todo is removed and it is removed in the end table should be kept. A 'Toader' has been hosted, which has not been removed from the list of 'Tudo'.

Question: How will I remove it from the 'Current Tudo' list when the 'Tood' list is over? Another issue I got is getting the Firebase DB to "expire" from "false" to "timely" from "true". I know that this is doing in the browser, because I've put $ Voice on it, but it's not moving forward for DB.

Any pointers will be appreciated!

(I think the part is that I filtered, but I'm sure there is something else missing.)

Inner angle controller:

  $ scope.addTodo = function () {$ scope.todos. $ Add ({text: $ scope.newTodo, date: $ scope.newDate, done: wrong, expired: incorrect}} $ $ scope.newTodo = ''; $ Scope.newDate = '';}; $ Scope .removeTodo = function (todo) {$ scope.todos. $ Remove (todo);}; $ Scope.todoChange = function (todo) {if (todo.done & scope.show === 'complete') {True fact;} And if (! Todo.done & amp; $ scope.show === 'current') {back true;} other {return false;}}; $ Scope.todoExpired = function (todo) {var Today = new date (); var fDate = new date (todo.date); FDate.setDate (fDate.getDate (+ + 7); if (today & gt; FDT) {return true;} other {return false;} };  

Repeat = '(id, todo) in todos | filter: todoChange'>

Pan & gt; {{IndexName} 1 /} & lt; / scan & gt; & lt; / td & gt; & lt; td & gt; & lt; duration & gt; {{todo.text}} & Lt; / span & gt; & lt; / TD & gt; & lt; td & gt; & lt; duration & gt; {{todo.date}} & lt; / span & gt; & lt; / TD & gt; & lt; td & gt; & lt; input type = 'checkbox' ng-model = 'todo.done' ng-change = 'todos. $ Save (todo) '& gt; & Lt; / Td> & Lt; Td> & Lt; Button class = 'BTN BTN-threat' ng-click = 'todo' & gt; Remove & lt; / Button & gt; & Lt; / Td> & Lt; / TR & gt;

End Page:

  & lt; Tr class = 'result' ng-repeat = 'todo in todo | Filter: todoExpired '& gt; & Lt; Td> & Lt; Span & gt; {{$ Index}}  / Scan & gt; & Lt; / Td> & Lt; TD & gt; & Lt; Period & gt; {{Todo.text}} & lt; / Span & gt; & Lt; / TD & gt; & Lt; TD & gt; & Lt; Period & gt; {{Todo.date}} & lt; / Span & gt; & Lt; / TD & gt; & Lt; TD & gt; Expired & lt; / TD & gt; & Lt; Td> & Lt; Button class = 'BTN BTN-threat' ng-click = 'todo' & gt; Remove & lt; / Button & gt; & Lt; / Td> & Lt; / TR & gt;   

Update:

I came to know that ng-hide = 'todoExpired (todo)' table In. It has created all the finished todos hidden on the current page and has only been seen on the page that has been finished.

So I thought it was possible through $ watch and Ng-hide = 'todoExpired (todo)' by adding it to the 'current' table.

The clock () code is as follows:

  $ scope.todos. $ Watch (function (newview, oldview) {if (OldValue == newValue) {return;} _.each ($ scope.todos, function (element, item, index) {if ($ scope.todoExpired (element)) { Element.expired = true; $ scope.todos. $ Save (element);}})});   

I do not know how efficient this answer is, but it does the trick.

Comments

Popular posts from this blog

java - ImportError: No module named py4j.java_gateway -

python - Receiving "KeyError" after decoding json result from url -

.net - Creating a new Queue Manager and Queue in Websphere MQ (using C#) -