I am trying to update a single record in Firebase using the $save() promise
as $update() is no longer valid but I am having serious problems with my
whole data source being deleted each time I run the update function:


$scope.update = function() { var fb = new
Firebase("https://mysource.firebaseio.com/Articles/" +
$scope.postToUpdate.$id); var article = $firebaseObject(ref);
article.$save({ Title: $scope.postToUpdate.Title, Body:
$scope.postToUpdate.Body }).then(function(ref) {
$('#editModal').modal('hide'); console.log($scope.postToUpdate); },
function(error) { console.log("Error:", error); });

I am running into a lot of problems with these migration issues with
Angularfire, all I want to do is to update a single record after a user has
edited it in a preloaded form. What is the equivalent of $update() in the
new Angularjs version?

--
You received this message because you are subscribed to the Google Groups "Firebase + AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firebase-angular+unsubscribe@googlegroups.com.
To post to this group, send email to firebase-angular@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/firebase-angular/d8ad3459-3e3f-437a-80e4-717fbffdb261%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Search Discussions

  • Viceberg at Oct 6, 2015 at 11:25 am
    Just do
    article.title = 'hello';
    article.$save();


    Envoyé de mon iPhone. Il se peut que ce message soit bref.
    On 5 oct. 2015, at 11:27, TPRA wrote:

    I am trying to update a single record in Firebase using the $save() promise as $update() is no longer valid but I am having serious problems with my whole data source being deleted each time I run the update function:


    $scope.update = function() {
    var fb = new Firebase("https://mysource.firebaseio.com/Articles/" + $scope.postToUpdate.$id);
    var article = $firebaseObject(ref);
    article.$save({
    Title: $scope.postToUpdate.Title,
    Body: $scope.postToUpdate.Body
    }).then(function(ref) {
    $('#editModal').modal('hide');
    console.log($scope.postToUpdate);
    }, function(error) {
    console.log("Error:", error);
    });

    I am running into a lot of problems with these migration issues with Angularfire, all I want to do is to update a single record after a user has edited it in a preloaded form. What is the equivalent of $update() in the new Angularjs version?
    --
    You received this message because you are subscribed to the Google Groups "Firebase + AngularJS" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to firebase-angular+unsubscribe@googlegroups.com.
    To post to this group, send email to firebase-angular@googlegroups.com.
    To view this discussion on the web visit https://groups.google.com/d/msgid/firebase-angular/d8ad3459-3e3f-437a-80e4-717fbffdb261%40googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
    --
    You received this message because you are subscribed to the Google Groups "Firebase + AngularJS" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to firebase-angular+unsubscribe@googlegroups.com.
    To post to this group, send email to firebase-angular@googlegroups.com.
    To view this discussion on the web visit https://groups.google.com/d/msgid/firebase-angular/6E6D996B-BD32-485C-9589-63C8F43B14C6%40gmail.com.
    For more options, visit https://groups.google.com/d/optout.
  • Jacob Wenger at Oct 8, 2015 at 5:38 am
    Yup, it's as simple as that! You can find a larger example of
    $firebaseObject.$save() in our API docs
    <https://www.firebase.com/docs/web/libraries/angular/api.html#angularfire-firebaseobject-save>
    .

    Jacob
    On Tue, Oct 6, 2015 at 4:25 AM, wrote:

    Just do
    article.title = 'hello';
    article.$save();


    Envoyé de mon iPhone. Il se peut que ce message soit bref.

    On 5 oct. 2015, at 11:27, TPRA wrote:

    I am trying to update a single record in Firebase using the $save()
    promise as $update() is no longer valid but I am having serious problems
    with my whole data source being deleted each time I run the update function:


    $scope.update = function() { var fb = new Firebase("
    https://mysource.firebaseio.com/Articles/" + $scope.postToUpdate.$id);
    var article = $firebaseObject(ref); article.$save({ Title:
    $scope.postToUpdate.Title, Body: $scope.postToUpdate.Body
    }).then(function(ref) { $('#editModal').modal('hide');
    console.log($scope.postToUpdate); }, function(error) {
    console.log("Error:", error); });

    I am running into a lot of problems with these migration issues with
    Angularfire, all I want to do is to update a single record after a user has
    edited it in a preloaded form. What is the equivalent of $update() in the
    new Angularjs version?

    --
    You received this message because you are subscribed to the Google Groups
    "Firebase + AngularJS" group.
    To unsubscribe from this group and stop receiving emails from it, send an
    email to firebase-angular+unsubscribe@googlegroups.com.
    To post to this group, send email to firebase-angular@googlegroups.com.
    To view this discussion on the web visit
    https://groups.google.com/d/msgid/firebase-angular/d8ad3459-3e3f-437a-80e4-717fbffdb261%40googlegroups.com
    <https://groups.google.com/d/msgid/firebase-angular/d8ad3459-3e3f-437a-80e4-717fbffdb261%40googlegroups.com?utm_medium=email&utm_source=footer>
    .
    For more options, visit https://groups.google.com/d/optout.

    --
    You received this message because you are subscribed to the Google Groups
    "Firebase + AngularJS" group.
    To unsubscribe from this group and stop receiving emails from it, send an
    email to firebase-angular+unsubscribe@googlegroups.com.
    To post to this group, send email to firebase-angular@googlegroups.com.
    To view this discussion on the web visit
    https://groups.google.com/d/msgid/firebase-angular/6E6D996B-BD32-485C-9589-63C8F43B14C6%40gmail.com
    <https://groups.google.com/d/msgid/firebase-angular/6E6D996B-BD32-485C-9589-63C8F43B14C6%40gmail.com?utm_medium=email&utm_source=footer>
    .

    For more options, visit https://groups.google.com/d/optout.
    --
    You received this message because you are subscribed to the Google Groups "Firebase + AngularJS" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to firebase-angular+unsubscribe@googlegroups.com.
    To post to this group, send email to firebase-angular@googlegroups.com.
    To view this discussion on the web visit https://groups.google.com/d/msgid/firebase-angular/CAGcMwsCXkBCW53ujqxfhwEtZwTdyMfwOVfy3QX_pqE1%3DvYMrOQ%40mail.gmail.com.
    For more options, visit https://groups.google.com/d/optout.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupfirebase-angular @
postedOct 6, '15 at 6:49a
activeOct 8, '15 at 5:38a
posts3
users3

3 users in discussion

Jacob Wenger: 1 post TPRA: 1 post Viceberg: 1 post

People

Translate

site design / logo © 2021 Grokbase