angularjs - Angularfire $save array -


I am trying to save the collection of data after updating an entry in the array.

  // Edit a post $ scope.editMe = function (message) {if ($ scope.textBoxMessage = "What did you do today?") {$ Scope.textBoxMessage = "here You can edit your post by entering a new message and pressing the "+" edit on the affected post. \ N \ n "+" Your post: "+" \ n "+ message.post; } And {$ scope.message.post = "hello"; //$scope.newMessage $ scope.messages. $ Save (2); }}  

A user has entered some text in the textfield, I want to replace it with already stored data. It's written on message.data with some time. Since I have read data like this:

  var list = fbutil.syncArray ('posts /' + user.uid);  

I also tried to say just this:

  message.post = $ scope.newMessage; List $ Save ()  

None of these two methods work, but I'm sure this is a minor mistake

ed: According to the Accident of the Accident, Go to:

  list [2] .post = "hello"; . Save list (2);  

Should work but I have no luck.

OK how have I fixed it here:

The problem was to do more If the statement is otherwise, the server code along with $ Scope.textBoxMessage is always true no matter what it is and what is it bothering me even if I say that ($ scope.textBoxMessage = "hi ") This will be true.

I'm not sure why this is the case, but if you have any suggestions then do not hesitate to comment.

In this way I solve it:

  // Edit a post $ scope.editMe = function (message) {if ($ scope.newMessage == null) {$ Scope.textBoxMessage = "Here you can enter a new message and click on the affected post Edit your post by pressing edit \ n \ n "+" Your post: "+" \ n "+ message.post; } Other {message.post = $ scope.newMessage; . Save list $ (message); $ Scope.textBoxMessage = chatmessage; $ Scope.newMessage = null; }}  

Comments

Popular posts from this blog

java - Can't add JTree to JPanel of a JInternalFrame -

javascript - data.match(var) not working it seems -

javascript - How can I pause a jQuery .each() loop, while waiting for user input? -