I'm building an app for task and project management and the need for
overwriting the stored properties of some objects (without actually
changing the stored properties) appeared.
To put it simple, I have some "group of tasks" objects that works as
expected but there's a special group, a "personal group" which uses the
current logged in user for dynamically changing itself.

E.g.:
When I show a group's dashboard page, there's a group's thumbnail image,
which is stored normally in a "picture" property on firebase.
But when I go to this personal group's dashboard, I want this picture to be
replaced by the current user's picture, without replicating the url on the
group/picture path every time the user changes its picture.

When I try to use the $extendFactory, what appears to happen is that the
property is overwritten by the downloaded properties (as they are
downloaded from server after I extend the original object). I can be really
off the mark here. But is there any way I can accomplish this? Or any
reason why this is a bad idea and I should go the duplicating stuff path?

Thanks.

--
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/4d9cf9ee-a292-41c1-a02e-54f98b9f2693%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Search Discussions

  • Georges Boris at Dec 2, 2014 at 6:35 pm
    I'll rephrase my question so it is more to the point.

    I'm getting an object like this from firebase:

    $groupId {
      picture: 'http://...",
      title: "group title"
    }

    I can add methods or other properties to it through
    $FirebaseObject.$extendFactory and it works great. But I when I try to
    overwrite one of the existing properties, the original property remains. Is
    there someway I could overwrite the picture property through $extendFactory
    or is this just not how this is supposed to work?

    something like:

    var userImage = userFactory.getUserImage();
    var groupFactory = $FirebaseObject.$extendFactory({
       picture: userImage
    });

    tks

    Em segunda-feira, 1 de dezembro de 2014 23h03min28s UTC-3, Georges Boris
    escreveu:
    I'm building an app for task and project management and the need for
    overwriting the stored properties of some objects (without actually
    changing the stored properties) appeared.
    To put it simple, I have some "group of tasks" objects that works as
    expected but there's a special group, a "personal group" which uses the
    current logged in user for dynamically changing itself.

    E.g.:
    When I show a group's dashboard page, there's a group's thumbnail image,
    which is stored normally in a "picture" property on firebase.
    But when I go to this personal group's dashboard, I want this picture to
    be replaced by the current user's picture, without replicating the url on
    the group/picture path every time the user changes its picture.

    When I try to use the $extendFactory, what appears to happen is that the
    property is overwritten by the downloaded properties (as they are
    downloaded from server after I extend the original object). I can be really
    off the mark here. But is there any way I can accomplish this? Or any
    reason why this is a bad idea and I should go the duplicating stuff path?

    Thanks.
    --
    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/5d095919-073d-4234-9ac5-8039aafad00a%40googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
  • Kato Richardson at Dec 2, 2014 at 7:37 pm
    I don't really understand the problem here. This is a synchronized object
    and it should be expected that the local data will exactly match the remote
    data.

    If you want to specify a default value, use $$defaults
    <https://www.firebase.com/docs/web/libraries/angular/guide.html#section-extending-factories>.
    If you want to specify values that are not synchronized, then you'll need
    to try an approach like the gist I linked, which stores all the
    synchronized data in `this.data` instead of directly on `this`.

    If you are attempting to specify a value that should be saved to the
    server, then make sure it gets applied after the object is fully loaded:

    var userImage = userFactory.getUserImage();
    var groupFactory = $FirebaseObject.$extendFactory(function() {
         var self = this;
         $FirebaseObject.apply(self, arguments);
         self.$loaded().then(function() {
              self.userImage = userImage;
              self.$save();
         });
    });

    If you are trying to do something else, you may need to provide details
    about the use case we're attempting to implement (usually a good starting
    point to save time and energy).

    Cheers,
    Kato


    On Tue, Dec 2, 2014 at 11:35 AM, Georges Boris wrote:

    I'll rephrase my question so it is more to the point.

    I'm getting an object like this from firebase:

    $groupId {
    picture: 'http://...",
    title: "group title"
    }

    I can add methods or other properties to it through
    $FirebaseObject.$extendFactory and it works great. But I when I try to
    overwrite one of the existing properties, the original property remains. Is
    there someway I could overwrite the picture property through $extendFactory
    or is this just not how this is supposed to work?

    something like:

    var userImage = userFactory.getUserImage();
    var groupFactory = $FirebaseObject.$extendFactory({
    picture: userImage
    });

    tks

    Em segunda-feira, 1 de dezembro de 2014 23h03min28s UTC-3, Georges Boris
    escreveu:
    I'm building an app for task and project management and the need for
    overwriting the stored properties of some objects (without actually
    changing the stored properties) appeared.
    To put it simple, I have some "group of tasks" objects that works as
    expected but there's a special group, a "personal group" which uses the
    current logged in user for dynamically changing itself.

    E.g.:
    When I show a group's dashboard page, there's a group's thumbnail image,
    which is stored normally in a "picture" property on firebase.
    But when I go to this personal group's dashboard, I want this picture to
    be replaced by the current user's picture, without replicating the url on
    the group/picture path every time the user changes its picture.

    When I try to use the $extendFactory, what appears to happen is that the
    property is overwritten by the downloaded properties (as they are
    downloaded from server after I extend the original object). I can be really
    off the mark here. But is there any way I can accomplish this? Or any
    reason why this is a bad idea and I should go the duplicating stuff path?

    Thanks.
    --
    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/5d095919-073d-4234-9ac5-8039aafad00a%40googlegroups.com
    <https://groups.google.com/d/msgid/firebase-angular/5d095919-073d-4234-9ac5-8039aafad00a%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/CADypTEaP%3DR4Gg8Vh-YkJ_fA5ZgM-s7mumk7zksPjRg%2Bpm0phkA%40mail.gmail.com.
    For more options, visit https://groups.google.com/d/optout.
  • Georges Boris at Dec 2, 2014 at 8:14 pm
    the use case is as I've said...

    I have a group object on my app. Each group has a title + picture url as
    properties.
    There's one special group though, that is my user group, that has it's
    thumbnail picture linked to the user's current thumbnail.
    I could be saving the user's picture on the group every time there was a
    change but I felt like the cleanest solution would be to just use the
    user's picture directly... Overwriting the group's picture property.

    That been said I think the solution of saving the synced data to this.data
    might work. thanks.

    2014-12-02 16:37 GMT-03:00 Kato Richardson <wulf@firebase.com>:
    I don't really understand the problem here. This is a synchronized object
    and it should be expected that the local data will exactly match the remote
    data.

    If you want to specify a default value, use $$defaults
    <https://www.firebase.com/docs/web/libraries/angular/guide.html#section-extending-factories>.
    If you want to specify values that are not synchronized, then you'll need
    to try an approach like the gist I linked, which stores all the
    synchronized data in `this.data` instead of directly on `this`.

    If you are attempting to specify a value that should be saved to the
    server, then make sure it gets applied after the object is fully loaded:

    var userImage = userFactory.getUserImage();
    var groupFactory = $FirebaseObject.$extendFactory(function() {
    var self = this;
    $FirebaseObject.apply(self, arguments);
    self.$loaded().then(function() {
    self.userImage = userImage;
    self.$save();
    });
    });

    If you are trying to do something else, you may need to provide details
    about the use case we're attempting to implement (usually a good starting
    point to save time and energy).

    Cheers,
    Kato


    On Tue, Dec 2, 2014 at 11:35 AM, Georges Boris wrote:

    I'll rephrase my question so it is more to the point.

    I'm getting an object like this from firebase:

    $groupId {
    picture: 'http://...",
    title: "group title"
    }

    I can add methods or other properties to it through
    $FirebaseObject.$extendFactory and it works great. But I when I try to
    overwrite one of the existing properties, the original property remains. Is
    there someway I could overwrite the picture property through $extendFactory
    or is this just not how this is supposed to work?

    something like:

    var userImage = userFactory.getUserImage();
    var groupFactory = $FirebaseObject.$extendFactory({
    picture: userImage
    });

    tks

    Em segunda-feira, 1 de dezembro de 2014 23h03min28s UTC-3, Georges Boris
    escreveu:
    I'm building an app for task and project management and the need for
    overwriting the stored properties of some objects (without actually
    changing the stored properties) appeared.
    To put it simple, I have some "group of tasks" objects that works as
    expected but there's a special group, a "personal group" which uses the
    current logged in user for dynamically changing itself.

    E.g.:
    When I show a group's dashboard page, there's a group's thumbnail image,
    which is stored normally in a "picture" property on firebase.
    But when I go to this personal group's dashboard, I want this picture to
    be replaced by the current user's picture, without replicating the url on
    the group/picture path every time the user changes its picture.

    When I try to use the $extendFactory, what appears to happen is that the
    property is overwritten by the downloaded properties (as they are
    downloaded from server after I extend the original object). I can be really
    off the mark here. But is there any way I can accomplish this? Or any
    reason why this is a bad idea and I should go the duplicating stuff path?

    Thanks.
    --
    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/5d095919-073d-4234-9ac5-8039aafad00a%40googlegroups.com
    <https://groups.google.com/d/msgid/firebase-angular/5d095919-073d-4234-9ac5-8039aafad00a%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 a topic in the
    Google Groups "Firebase + AngularJS" group.
    To unsubscribe from this topic, visit
    https://groups.google.com/d/topic/firebase-angular/FSynHvgSQJE/unsubscribe
    .
    To unsubscribe from this group and all its topics, 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/CADypTEaP%3DR4Gg8Vh-YkJ_fA5ZgM-s7mumk7zksPjRg%2Bpm0phkA%40mail.gmail.com
    <https://groups.google.com/d/msgid/firebase-angular/CADypTEaP%3DR4Gg8Vh-YkJ_fA5ZgM-s7mumk7zksPjRg%2Bpm0phkA%40mail.gmail.com?utm_medium=email&utm_source=footer>
    .

    For more options, visit https://groups.google.com/d/optout.


    --

    Georges Boris
    11 986 463 868

    --
    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/CAPyfT%2B__r%2Bid%3DKVWi7-b93rCQb0JUx1XPgr4hMARd9f8Xq9d3Q%40mail.gmail.com.
    For more options, visit https://groups.google.com/d/optout.
  • Jacob Wenger at Dec 3, 2014 at 7:44 am
    Hey Georges,

    Just to throw my two cents in here, I think you are overthinking the
    problem and should just go with the solution you mentioned in your first
    message: duplicate the data. Data duplication/bandwidth is so cheap and it
    would save you the effort of trying to extend the AngularFire factories.
    You are more than welcome to do so (as Kato pointed out), but if it was me,
    I would just store the image URL twice and be done with it.

    ​Jacob​

    On Tue, Dec 2, 2014 at 12:14 PM, Georges Boris wrote:

    the use case is as I've said...

    I have a group object on my app. Each group has a title + picture url as
    properties.
    There's one special group though, that is my user group, that has it's
    thumbnail picture linked to the user's current thumbnail.
    I could be saving the user's picture on the group every time there was a
    change but I felt like the cleanest solution would be to just use the
    user's picture directly... Overwriting the group's picture property.

    That been said I think the solution of saving the synced data to this.data
    might work. thanks.

    2014-12-02 16:37 GMT-03:00 Kato Richardson <wulf@firebase.com>:
    I don't really understand the problem here. This is a synchronized object
    and it should be expected that the local data will exactly match the remote
    data.

    If you want to specify a default value, use $$defaults
    <https://www.firebase.com/docs/web/libraries/angular/guide.html#section-extending-factories>.
    If you want to specify values that are not synchronized, then you'll need
    to try an approach like the gist I linked, which stores all the
    synchronized data in `this.data` instead of directly on `this`.

    If you are attempting to specify a value that should be saved to the
    server, then make sure it gets applied after the object is fully loaded:

    var userImage = userFactory.getUserImage();
    var groupFactory = $FirebaseObject.$extendFactory(function() {
    var self = this;
    $FirebaseObject.apply(self, arguments);
    self.$loaded().then(function() {
    self.userImage = userImage;
    self.$save();
    });
    });

    If you are trying to do something else, you may need to provide details
    about the use case we're attempting to implement (usually a good starting
    point to save time and energy).

    Cheers,
    Kato



    On Tue, Dec 2, 2014 at 11:35 AM, Georges Boris <georgesboris@gmail.com>
    wrote:
    I'll rephrase my question so it is more to the point.

    I'm getting an object like this from firebase:

    $groupId {
    picture: 'http://...",
    title: "group title"
    }

    I can add methods or other properties to it through
    $FirebaseObject.$extendFactory and it works great. But I when I try to
    overwrite one of the existing properties, the original property remains. Is
    there someway I could overwrite the picture property through $extendFactory
    or is this just not how this is supposed to work?

    something like:

    var userImage = userFactory.getUserImage();
    var groupFactory = $FirebaseObject.$extendFactory({
    picture: userImage
    });

    tks

    Em segunda-feira, 1 de dezembro de 2014 23h03min28s UTC-3, Georges Boris
    escreveu:
    I'm building an app for task and project management and the need for
    overwriting the stored properties of some objects (without actually
    changing the stored properties) appeared.
    To put it simple, I have some "group of tasks" objects that works as
    expected but there's a special group, a "personal group" which uses the
    current logged in user for dynamically changing itself.

    E.g.:
    When I show a group's dashboard page, there's a group's thumbnail
    image, which is stored normally in a "picture" property on firebase.
    But when I go to this personal group's dashboard, I want this picture
    to be replaced by the current user's picture, without replicating the url
    on the group/picture path every time the user changes its picture.

    When I try to use the $extendFactory, what appears to happen is that
    the property is overwritten by the downloaded properties (as they are
    downloaded from server after I extend the original object). I can be really
    off the mark here. But is there any way I can accomplish this? Or any
    reason why this is a bad idea and I should go the duplicating stuff path?

    Thanks.
    --
    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/5d095919-073d-4234-9ac5-8039aafad00a%40googlegroups.com
    <https://groups.google.com/d/msgid/firebase-angular/5d095919-073d-4234-9ac5-8039aafad00a%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 a topic in the
    Google Groups "Firebase + AngularJS" group.
    To unsubscribe from this topic, visit
    https://groups.google.com/d/topic/firebase-angular/FSynHvgSQJE/unsubscribe
    .
    To unsubscribe from this group and all its topics, 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/CADypTEaP%3DR4Gg8Vh-YkJ_fA5ZgM-s7mumk7zksPjRg%2Bpm0phkA%40mail.gmail.com
    <https://groups.google.com/d/msgid/firebase-angular/CADypTEaP%3DR4Gg8Vh-YkJ_fA5ZgM-s7mumk7zksPjRg%2Bpm0phkA%40mail.gmail.com?utm_medium=email&utm_source=footer>
    .

    For more options, visit https://groups.google.com/d/optout.


    --

    Georges Boris
    11 986 463 868

    --
    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/CAPyfT%2B__r%2Bid%3DKVWi7-b93rCQb0JUx1XPgr4hMARd9f8Xq9d3Q%40mail.gmail.com
    <https://groups.google.com/d/msgid/firebase-angular/CAPyfT%2B__r%2Bid%3DKVWi7-b93rCQb0JUx1XPgr4hMARd9f8Xq9d3Q%40mail.gmail.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/CAGcMwsDG%2Bf_AkgKhQy1Jjo-g2gvvjcxHRPxcaPohm9YUkJ%3D80A%40mail.gmail.com.
    For more options, visit https://groups.google.com/d/optout.
  • Georges Boris at Dec 3, 2014 at 11:37 am
    Tks jacob. Yeah, you're right. But that raises another question.

    How do you make interdependent changes like this one in a proper way with firebase? I feel like trusting the client for making multiple async operations is not the way to go. I was thinking about creating another back-end (like a node.js app) that would be in charge of making all these alterations to the firebase data that require multiple changes to effectly occur. Do you feel like that is a common approach when dealing with a front-end only enviroment like firebase or am I overthinking this as well?

    (I'm aware that the example mentioned about the thumbnail is really simple. But there are others that are more elaborate. Like creating notifications for all participants of a group based on a lot of different actions)

    Tks for the help

    Enviado via meu smartphone
    Le 03/12/2014 à 04:43, Jacob Wenger <jacob@firebase.com> a écrit :

    Hey Georges,

    Just to throw my two cents in here, I think you are overthinking the problem and should just go with the solution you mentioned in your first message: duplicate the data. Data duplication/bandwidth is so cheap and it would save you the effort of trying to extend the AngularFire factories. You are more than welcome to do so (as Kato pointed out), but if it was me, I would just store the image URL twice and be done with it.

    ​Jacob​

    On Tue, Dec 2, 2014 at 12:14 PM, Georges Boris wrote:
    the use case is as I've said...

    I have a group object on my app. Each group has a title + picture url as properties.
    There's one special group though, that is my user group, that has it's thumbnail picture linked to the user's current thumbnail.
    I could be saving the user's picture on the group every time there was a change but I felt like the cleanest solution would be to just use the user's picture directly... Overwriting the group's picture property.

    That been said I think the solution of saving the synced data to this.data might work. thanks.

    2014-12-02 16:37 GMT-03:00 Kato Richardson <wulf@firebase.com>:
    I don't really understand the problem here. This is a synchronized object and it should be expected that the local data will exactly match the remote data.

    If you want to specify a default value, use $$defaults. If you want to specify values that are not synchronized, then you'll need to try an approach like the gist I linked, which stores all the synchronized data in `this.data` instead of directly on `this`.

    If you are attempting to specify a value that should be saved to the server, then make sure it gets applied after the object is fully loaded:

    var userImage = userFactory.getUserImage();
    var groupFactory = $FirebaseObject.$extendFactory(function() {
    var self = this;
    $FirebaseObject.apply(self, arguments);
    self.$loaded().then(function() {
    self.userImage = userImage;
    self.$save();
    });
    });

    If you are trying to do something else, you may need to provide details about the use case we're attempting to implement (usually a good starting point to save time and energy).

    Cheers,
    Kato


    On Tue, Dec 2, 2014 at 11:35 AM, Georges Boris wrote:
    I'll rephrase my question so it is more to the point.

    I'm getting an object like this from firebase:

    $groupId {
    picture: 'http://...",
    title: "group title"
    }

    I can add methods or other properties to it through $FirebaseObject.$extendFactory and it works great. But I when I try to overwrite one of the existing properties, the original property remains. Is there someway I could overwrite the picture property through $extendFactory or is this just not how this is supposed to work?

    something like:

    var userImage = userFactory.getUserImage();
    var groupFactory = $FirebaseObject.$extendFactory({
    picture: userImage
    });

    tks
    Em segunda-feira, 1 de dezembro de 2014 23h03min28s UTC-3, Georges Boris escreveu:
    I'm building an app for task and project management and the need for overwriting the stored properties of some objects (without actually changing the stored properties) appeared.
    To put it simple, I have some "group of tasks" objects that works as expected but there's a special group, a "personal group" which uses the current logged in user for dynamically changing itself.

    E.g.:
    When I show a group's dashboard page, there's a group's thumbnail image, which is stored normally in a "picture" property on firebase.
    But when I go to this personal group's dashboard, I want this picture to be replaced by the current user's picture, without replicating the url on the group/picture path every time the user changes its picture.

    When I try to use the $extendFactory, what appears to happen is that the property is overwritten by the downloaded properties (as they are downloaded from server after I extend the original object). I can be really off the mark here. But is there any way I can accomplish this? Or any reason why this is a bad idea and I should go the duplicating stuff path?

    Thanks.
    --
    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/5d095919-073d-4234-9ac5-8039aafad00a%40googlegroups.com.

    For more options, visit https://groups.google.com/d/optout.
    --
    You received this message because you are subscribed to a topic in the Google Groups "Firebase + AngularJS" group.
    To unsubscribe from this topic, visit https://groups.google.com/d/topic/firebase-angular/FSynHvgSQJE/unsubscribe.
    To unsubscribe from this group and all its topics, 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/CADypTEaP%3DR4Gg8Vh-YkJ_fA5ZgM-s7mumk7zksPjRg%2Bpm0phkA%40mail.gmail.com.

    For more options, visit https://groups.google.com/d/optout.


    --

    Georges Boris
    11 986 463 868
    --
    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/CAPyfT%2B__r%2Bid%3DKVWi7-b93rCQb0JUx1XPgr4hMARd9f8Xq9d3Q%40mail.gmail.com.

    For more options, visit https://groups.google.com/d/optout.
    --
    You received this message because you are subscribed to a topic in the Google Groups "Firebase + AngularJS" group.
    To unsubscribe from this topic, visit https://groups.google.com/d/topic/firebase-angular/FSynHvgSQJE/unsubscribe.
    To unsubscribe from this group and all its topics, 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/CAGcMwsDG%2Bf_AkgKhQy1Jjo-g2gvvjcxHRPxcaPohm9YUkJ%3D80A%40mail.gmail.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/448A4C5B-6338-4250-B211-6589B0FA5EBF%40gmail.com.
    For more options, visit https://groups.google.com/d/optout.
  • Jacob Wenger at Dec 5, 2014 at 7:11 am
    Georges,

    You touch on great point about trusting the client to update all relevant
    places in your Firebase. It is true that a write to one place could succeed
    but the corresponding write to another place could fail. This could happen
    if your app is going on and offline. Thankfully, Firebase handles this
    situation pretty well and will eventually succeed in the write once you
    regain a connection. If your app never does regain that connection though,
    there is little we can do.

    To work around this, I would suggestion architecting your data in such a
    way that you can handle these edge cases. They are rare enough that most
    users won't be affected, but you want to make sure your app won't crash and
    burn if they do. If the writes are mission critical, I would make sure that
    you have a backend process that ensures both writes occur. For
    notifications, you should be fine writing to both places and if one out of
    every few thousand writes fail, it's probably not the end of the world.

    Another option you could have is to have some sort of cron job which runs
    regularly and makes sure all the data is correct. It can backfill in any
    data that for some reason did not complete properly.

    The good news for you is that we are actively working on this problem. We
    recently demoed a feature called Triggers which would allow you to write to
    one place and have us handle the fanout to other parts of your Firebase. It
    will allow you to easily flatten your data. That feature is not even in
    beta yet, but we are actively working on making it a reality!

    Jacob
    On Wed, Dec 3, 2014 at 3:36 AM, Georges Boris wrote:

    Tks jacob. Yeah, you're right. But that raises another question.

    How do you make interdependent changes like this one in a proper way with
    firebase? I feel like trusting the client for making multiple async
    operations is not the way to go. I was thinking about creating another
    back-end (like a node.js app) that would be in charge of making all these
    alterations to the firebase data that require multiple changes to effectly
    occur. Do you feel like that is a common approach when dealing with a
    front-end only enviroment like firebase or am I overthinking this as well?

    (I'm aware that the example mentioned about the thumbnail is really
    simple. But there are others that are more elaborate. Like creating
    notifications for all participants of a group based on a lot of different
    actions)

    Tks for the help

    Enviado via meu smartphone

    Le 03/12/2014 à 04:43, Jacob Wenger <jacob@firebase.com> a écrit :

    Hey Georges,

    Just to throw my two cents in here, I think you are overthinking the
    problem and should just go with the solution you mentioned in your first
    message: duplicate the data. Data duplication/bandwidth is so cheap and it
    would save you the effort of trying to extend the AngularFire factories.
    You are more than welcome to do so (as Kato pointed out), but if it was me,
    I would just store the image URL twice and be done with it.

    ​Jacob​

    On Tue, Dec 2, 2014 at 12:14 PM, Georges Boris wrote:

    the use case is as I've said...

    I have a group object on my app. Each group has a title + picture url as
    properties.
    There's one special group though, that is my user group, that has it's
    thumbnail picture linked to the user's current thumbnail.
    I could be saving the user's picture on the group every time there was a
    change but I felt like the cleanest solution would be to just use the
    user's picture directly... Overwriting the group's picture property.

    That been said I think the solution of saving the synced data to
    this.data might work. thanks.

    2014-12-02 16:37 GMT-03:00 Kato Richardson <wulf@firebase.com>:
    I don't really understand the problem here. This is a synchronized
    object and it should be expected that the local data will exactly match the
    remote data.

    If you want to specify a default value, use $$defaults
    <https://www.firebase.com/docs/web/libraries/angular/guide.html#section-extending-factories>.
    If you want to specify values that are not synchronized, then you'll need
    to try an approach like the gist I linked, which stores all the
    synchronized data in `this.data` instead of directly on `this`.

    If you are attempting to specify a value that should be saved to the
    server, then make sure it gets applied after the object is fully loaded:

    var userImage = userFactory.getUserImage();
    var groupFactory = $FirebaseObject.$extendFactory(function() {
    var self = this;
    $FirebaseObject.apply(self, arguments);
    self.$loaded().then(function() {
    self.userImage = userImage;
    self.$save();
    });
    });

    If you are trying to do something else, you may need to provide details
    about the use case we're attempting to implement (usually a good starting
    point to save time and energy).

    Cheers,
    Kato



    On Tue, Dec 2, 2014 at 11:35 AM, Georges Boris <georgesboris@gmail.com>
    wrote:
    I'll rephrase my question so it is more to the point.

    I'm getting an object like this from firebase:

    $groupId {
    picture: 'http://...",
    title: "group title"
    }

    I can add methods or other properties to it through
    $FirebaseObject.$extendFactory and it works great. But I when I try to
    overwrite one of the existing properties, the original property remains. Is
    there someway I could overwrite the picture property through $extendFactory
    or is this just not how this is supposed to work?

    something like:

    var userImage = userFactory.getUserImage();
    var groupFactory = $FirebaseObject.$extendFactory({
    picture: userImage
    });

    tks

    Em segunda-feira, 1 de dezembro de 2014 23h03min28s UTC-3, Georges
    Boris escreveu:
    I'm building an app for task and project management and the need for
    overwriting the stored properties of some objects (without actually
    changing the stored properties) appeared.
    To put it simple, I have some "group of tasks" objects that works as
    expected but there's a special group, a "personal group" which uses the
    current logged in user for dynamically changing itself.

    E.g.:
    When I show a group's dashboard page, there's a group's thumbnail
    image, which is stored normally in a "picture" property on firebase.
    But when I go to this personal group's dashboard, I want this picture
    to be replaced by the current user's picture, without replicating the url
    on the group/picture path every time the user changes its picture.

    When I try to use the $extendFactory, what appears to happen is that
    the property is overwritten by the downloaded properties (as they are
    downloaded from server after I extend the original object). I can be really
    off the mark here. But is there any way I can accomplish this? Or any
    reason why this is a bad idea and I should go the duplicating stuff path?

    Thanks.
    --
    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/5d095919-073d-4234-9ac5-8039aafad00a%40googlegroups.com
    <https://groups.google.com/d/msgid/firebase-angular/5d095919-073d-4234-9ac5-8039aafad00a%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 a topic in the
    Google Groups "Firebase + AngularJS" group.
    To unsubscribe from this topic, visit
    https://groups.google.com/d/topic/firebase-angular/FSynHvgSQJE/unsubscribe
    .
    To unsubscribe from this group and all its topics, 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/CADypTEaP%3DR4Gg8Vh-YkJ_fA5ZgM-s7mumk7zksPjRg%2Bpm0phkA%40mail.gmail.com
    <https://groups.google.com/d/msgid/firebase-angular/CADypTEaP%3DR4Gg8Vh-YkJ_fA5ZgM-s7mumk7zksPjRg%2Bpm0phkA%40mail.gmail.com?utm_medium=email&utm_source=footer>
    .

    For more options, visit https://groups.google.com/d/optout.


    --

    Georges Boris
    11 986 463 868

    --
    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/CAPyfT%2B__r%2Bid%3DKVWi7-b93rCQb0JUx1XPgr4hMARd9f8Xq9d3Q%40mail.gmail.com
    <https://groups.google.com/d/msgid/firebase-angular/CAPyfT%2B__r%2Bid%3DKVWi7-b93rCQb0JUx1XPgr4hMARd9f8Xq9d3Q%40mail.gmail.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 a topic in the
    Google Groups "Firebase + AngularJS" group.
    To unsubscribe from this topic, visit
    https://groups.google.com/d/topic/firebase-angular/FSynHvgSQJE/unsubscribe
    .
    To unsubscribe from this group and all its topics, 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/CAGcMwsDG%2Bf_AkgKhQy1Jjo-g2gvvjcxHRPxcaPohm9YUkJ%3D80A%40mail.gmail.com
    <https://groups.google.com/d/msgid/firebase-angular/CAGcMwsDG%2Bf_AkgKhQy1Jjo-g2gvvjcxHRPxcaPohm9YUkJ%3D80A%40mail.gmail.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/448A4C5B-6338-4250-B211-6589B0FA5EBF%40gmail.com
    <https://groups.google.com/d/msgid/firebase-angular/448A4C5B-6338-4250-B211-6589B0FA5EBF%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/CAGcMwsCYYqeFEicqn7QZiUDk-CUr5ANr3w7N_j0jWf-Bo%3DMbgw%40mail.gmail.com.
    For more options, visit https://groups.google.com/d/optout.
  • Georges Boris at Dec 5, 2014 at 11:01 am
    hey jacob, thanks for the feedback.

    great to hear about this new feature concerning this scenario!
    looking forward to see more of it! meanwhile I guess I'll continue with the
    development of a support backend for this types of situations. the only
    problem I get when developing this type of parallel processing is
    maintaining the authentication synced between both client and backend
    acting as client on firebase. but I guess I'm filling this thread with too
    many concerns.

    cheers!


    2014-12-05 4:10 GMT-03:00 Jacob Wenger <jacob@firebase.com>:
    Georges,

    You touch on great point about trusting the client to update all relevant
    places in your Firebase. It is true that a write to one place could succeed
    but the corresponding write to another place could fail. This could happen
    if your app is going on and offline. Thankfully, Firebase handles this
    situation pretty well and will eventually succeed in the write once you
    regain a connection. If your app never does regain that connection though,
    there is little we can do.

    To work around this, I would suggestion architecting your data in such a
    way that you can handle these edge cases. They are rare enough that most
    users won't be affected, but you want to make sure your app won't crash and
    burn if they do. If the writes are mission critical, I would make sure that
    you have a backend process that ensures both writes occur. For
    notifications, you should be fine writing to both places and if one out of
    every few thousand writes fail, it's probably not the end of the world.

    Another option you could have is to have some sort of cron job which runs
    regularly and makes sure all the data is correct. It can backfill in any
    data that for some reason did not complete properly.

    The good news for you is that we are actively working on this problem. We
    recently demoed a feature called Triggers which would allow you to write to
    one place and have us handle the fanout to other parts of your Firebase. It
    will allow you to easily flatten your data. That feature is not even in
    beta yet, but we are actively working on making it a reality!

    Jacob
    On Wed, Dec 3, 2014 at 3:36 AM, Georges Boris wrote:

    Tks jacob. Yeah, you're right. But that raises another question.

    How do you make interdependent changes like this one in a proper way with
    firebase? I feel like trusting the client for making multiple async
    operations is not the way to go. I was thinking about creating another
    back-end (like a node.js app) that would be in charge of making all these
    alterations to the firebase data that require multiple changes to effectly
    occur. Do you feel like that is a common approach when dealing with a
    front-end only enviroment like firebase or am I overthinking this as well?

    (I'm aware that the example mentioned about the thumbnail is really
    simple. But there are others that are more elaborate. Like creating
    notifications for all participants of a group based on a lot of different
    actions)

    Tks for the help

    Enviado via meu smartphone

    Le 03/12/2014 à 04:43, Jacob Wenger <jacob@firebase.com> a écrit :

    Hey Georges,

    Just to throw my two cents in here, I think you are overthinking the
    problem and should just go with the solution you mentioned in your first
    message: duplicate the data. Data duplication/bandwidth is so cheap and it
    would save you the effort of trying to extend the AngularFire factories.
    You are more than welcome to do so (as Kato pointed out), but if it was me,
    I would just store the image URL twice and be done with it.

    ​Jacob​


    On Tue, Dec 2, 2014 at 12:14 PM, Georges Boris <georgesboris@gmail.com>
    wrote:
    the use case is as I've said...

    I have a group object on my app. Each group has a title + picture url as
    properties.
    There's one special group though, that is my user group, that has it's
    thumbnail picture linked to the user's current thumbnail.
    I could be saving the user's picture on the group every time there was a
    change but I felt like the cleanest solution would be to just use the
    user's picture directly... Overwriting the group's picture property.

    That been said I think the solution of saving the synced data to
    this.data might work. thanks.

    2014-12-02 16:37 GMT-03:00 Kato Richardson <wulf@firebase.com>:
    I don't really understand the problem here. This is a synchronized
    object and it should be expected that the local data will exactly match the
    remote data.

    If you want to specify a default value, use $$defaults
    <https://www.firebase.com/docs/web/libraries/angular/guide.html#section-extending-factories>.
    If you want to specify values that are not synchronized, then you'll need
    to try an approach like the gist I linked, which stores all the
    synchronized data in `this.data` instead of directly on `this`.

    If you are attempting to specify a value that should be saved to the
    server, then make sure it gets applied after the object is fully loaded:

    var userImage = userFactory.getUserImage();
    var groupFactory = $FirebaseObject.$extendFactory(function() {
    var self = this;
    $FirebaseObject.apply(self, arguments);
    self.$loaded().then(function() {
    self.userImage = userImage;
    self.$save();
    });
    });

    If you are trying to do something else, you may need to provide details
    about the use case we're attempting to implement (usually a good starting
    point to save time and energy).

    Cheers,
    Kato



    On Tue, Dec 2, 2014 at 11:35 AM, Georges Boris <georgesboris@gmail.com>
    wrote:
    I'll rephrase my question so it is more to the point.

    I'm getting an object like this from firebase:

    $groupId {
    picture: 'http://...",
    title: "group title"
    }

    I can add methods or other properties to it through
    $FirebaseObject.$extendFactory and it works great. But I when I try to
    overwrite one of the existing properties, the original property remains. Is
    there someway I could overwrite the picture property through $extendFactory
    or is this just not how this is supposed to work?

    something like:

    var userImage = userFactory.getUserImage();
    var groupFactory = $FirebaseObject.$extendFactory({
    picture: userImage
    });

    tks

    Em segunda-feira, 1 de dezembro de 2014 23h03min28s UTC-3, Georges
    Boris escreveu:
    I'm building an app for task and project management and the need for
    overwriting the stored properties of some objects (without actually
    changing the stored properties) appeared.
    To put it simple, I have some "group of tasks" objects that works as
    expected but there's a special group, a "personal group" which uses the
    current logged in user for dynamically changing itself.

    E.g.:
    When I show a group's dashboard page, there's a group's thumbnail
    image, which is stored normally in a "picture" property on firebase.
    But when I go to this personal group's dashboard, I want this picture
    to be replaced by the current user's picture, without replicating the url
    on the group/picture path every time the user changes its picture.

    When I try to use the $extendFactory, what appears to happen is that
    the property is overwritten by the downloaded properties (as they are
    downloaded from server after I extend the original object). I can be really
    off the mark here. But is there any way I can accomplish this? Or any
    reason why this is a bad idea and I should go the duplicating stuff path?

    Thanks.
    --
    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/5d095919-073d-4234-9ac5-8039aafad00a%40googlegroups.com
    <https://groups.google.com/d/msgid/firebase-angular/5d095919-073d-4234-9ac5-8039aafad00a%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 a topic in the
    Google Groups "Firebase + AngularJS" group.
    To unsubscribe from this topic, visit
    https://groups.google.com/d/topic/firebase-angular/FSynHvgSQJE/unsubscribe
    .
    To unsubscribe from this group and all its topics, 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/CADypTEaP%3DR4Gg8Vh-YkJ_fA5ZgM-s7mumk7zksPjRg%2Bpm0phkA%40mail.gmail.com
    <https://groups.google.com/d/msgid/firebase-angular/CADypTEaP%3DR4Gg8Vh-YkJ_fA5ZgM-s7mumk7zksPjRg%2Bpm0phkA%40mail.gmail.com?utm_medium=email&utm_source=footer>
    .

    For more options, visit https://groups.google.com/d/optout.


    --

    Georges Boris
    11 986 463 868

    --
    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/CAPyfT%2B__r%2Bid%3DKVWi7-b93rCQb0JUx1XPgr4hMARd9f8Xq9d3Q%40mail.gmail.com
    <https://groups.google.com/d/msgid/firebase-angular/CAPyfT%2B__r%2Bid%3DKVWi7-b93rCQb0JUx1XPgr4hMARd9f8Xq9d3Q%40mail.gmail.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 a topic in the
    Google Groups "Firebase + AngularJS" group.
    To unsubscribe from this topic, visit
    https://groups.google.com/d/topic/firebase-angular/FSynHvgSQJE/unsubscribe
    .
    To unsubscribe from this group and all its topics, 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/CAGcMwsDG%2Bf_AkgKhQy1Jjo-g2gvvjcxHRPxcaPohm9YUkJ%3D80A%40mail.gmail.com
    <https://groups.google.com/d/msgid/firebase-angular/CAGcMwsDG%2Bf_AkgKhQy1Jjo-g2gvvjcxHRPxcaPohm9YUkJ%3D80A%40mail.gmail.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/448A4C5B-6338-4250-B211-6589B0FA5EBF%40gmail.com
    <https://groups.google.com/d/msgid/firebase-angular/448A4C5B-6338-4250-B211-6589B0FA5EBF%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 a topic in the
    Google Groups "Firebase + AngularJS" group.
    To unsubscribe from this topic, visit
    https://groups.google.com/d/topic/firebase-angular/FSynHvgSQJE/unsubscribe
    .
    To unsubscribe from this group and all its topics, 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/CAGcMwsCYYqeFEicqn7QZiUDk-CUr5ANr3w7N_j0jWf-Bo%3DMbgw%40mail.gmail.com
    <https://groups.google.com/d/msgid/firebase-angular/CAGcMwsCYYqeFEicqn7QZiUDk-CUr5ANr3w7N_j0jWf-Bo%3DMbgw%40mail.gmail.com?utm_medium=email&utm_source=footer>
    .

    For more options, visit https://groups.google.com/d/optout.


    --

    Georges Boris
    11 986 463 868

    --
    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/CAPyfT%2B_Z4NQs2ABoZEVn6agODKg-f9WucwCHGx0WrYY8S%2BBr6A%40mail.gmail.com.
    For more options, visit https://groups.google.com/d/optout.
  • Jacob Wenger at Dec 5, 2014 at 6:12 pm
    Georges,

    You can easily fake this by sending the uid and provider of your logged-in
    user along with the request to your secure backend, say by putting them in
    the query string. Then, on the backend, use one of our token generator
    libraries
    <https://www.firebase.com/docs/web/guide/login/custom.html#section-rest-token-helper-libraries>
    to generate a custom auth token. While this may seem like a lot of work, it
    is actually extremely easy. Here is some pseudocode of how you would do it
    in Node.js:

    var FirebaseTokenGenerator = require("firebase-token-generator");
    var tokenGenerator = new FirebaseTokenGenerator("<YOUR_FIREBASE_SECRET>");
    var token = tokenGenerator.createToken({
       uid: req.query.uid,
       provider: req.query.provider
    });

    var ref = new Firebase("https://<YOUR-FIREBASE>.firebaseio.com");
    ref.authWithCustomToken(token, function(error, authData) {
       if (error === null) {
         // now you are authenticated with the same permissions as you had
    client-side
       } else {
         console.log("Error:", error);
       }
    });

    Jacob
    On Fri, Dec 5, 2014 at 3:01 AM, Georges Boris wrote:

    hey jacob, thanks for the feedback.

    great to hear about this new feature concerning this scenario!
    looking forward to see more of it! meanwhile I guess I'll continue with
    the development of a support backend for this types of situations. the only
    problem I get when developing this type of parallel processing is
    maintaining the authentication synced between both client and backend
    acting as client on firebase. but I guess I'm filling this thread with too
    many concerns.

    cheers!


    2014-12-05 4:10 GMT-03:00 Jacob Wenger <jacob@firebase.com>:
    Georges,

    You touch on great point about trusting the client to update all relevant
    places in your Firebase. It is true that a write to one place could succeed
    but the corresponding write to another place could fail. This could happen
    if your app is going on and offline. Thankfully, Firebase handles this
    situation pretty well and will eventually succeed in the write once you
    regain a connection. If your app never does regain that connection though,
    there is little we can do.

    To work around this, I would suggestion architecting your data in such a
    way that you can handle these edge cases. They are rare enough that most
    users won't be affected, but you want to make sure your app won't crash and
    burn if they do. If the writes are mission critical, I would make sure that
    you have a backend process that ensures both writes occur. For
    notifications, you should be fine writing to both places and if one out of
    every few thousand writes fail, it's probably not the end of the world.

    Another option you could have is to have some sort of cron job which runs
    regularly and makes sure all the data is correct. It can backfill in any
    data that for some reason did not complete properly.

    The good news for you is that we are actively working on this problem. We
    recently demoed a feature called Triggers which would allow you to write to
    one place and have us handle the fanout to other parts of your Firebase. It
    will allow you to easily flatten your data. That feature is not even in
    beta yet, but we are actively working on making it a reality!

    Jacob

    On Wed, Dec 3, 2014 at 3:36 AM, Georges Boris <georgesboris@gmail.com>
    wrote:
    Tks jacob. Yeah, you're right. But that raises another question.

    How do you make interdependent changes like this one in a proper way
    with firebase? I feel like trusting the client for making multiple async
    operations is not the way to go. I was thinking about creating another
    back-end (like a node.js app) that would be in charge of making all these
    alterations to the firebase data that require multiple changes to effectly
    occur. Do you feel like that is a common approach when dealing with a
    front-end only enviroment like firebase or am I overthinking this as well?

    (I'm aware that the example mentioned about the thumbnail is really
    simple. But there are others that are more elaborate. Like creating
    notifications for all participants of a group based on a lot of different
    actions)

    Tks for the help

    Enviado via meu smartphone

    Le 03/12/2014 à 04:43, Jacob Wenger <jacob@firebase.com> a écrit :

    Hey Georges,

    Just to throw my two cents in here, I think you are overthinking the
    problem and should just go with the solution you mentioned in your first
    message: duplicate the data. Data duplication/bandwidth is so cheap and it
    would save you the effort of trying to extend the AngularFire factories.
    You are more than welcome to do so (as Kato pointed out), but if it was me,
    I would just store the image URL twice and be done with it.

    ​Jacob​


    On Tue, Dec 2, 2014 at 12:14 PM, Georges Boris <georgesboris@gmail.com>
    wrote:
    the use case is as I've said...

    I have a group object on my app. Each group has a title + picture url
    as properties.
    There's one special group though, that is my user group, that has it's
    thumbnail picture linked to the user's current thumbnail.
    I could be saving the user's picture on the group every time there was
    a change but I felt like the cleanest solution would be to just use the
    user's picture directly... Overwriting the group's picture property.

    That been said I think the solution of saving the synced data to
    this.data might work. thanks.

    2014-12-02 16:37 GMT-03:00 Kato Richardson <wulf@firebase.com>:
    I don't really understand the problem here. This is a synchronized
    object and it should be expected that the local data will exactly match the
    remote data.

    If you want to specify a default value, use $$defaults
    <https://www.firebase.com/docs/web/libraries/angular/guide.html#section-extending-factories>.
    If you want to specify values that are not synchronized, then you'll need
    to try an approach like the gist I linked, which stores all the
    synchronized data in `this.data` instead of directly on `this`.

    If you are attempting to specify a value that should be saved to the
    server, then make sure it gets applied after the object is fully loaded:

    var userImage = userFactory.getUserImage();
    var groupFactory = $FirebaseObject.$extendFactory(function() {
    var self = this;
    $FirebaseObject.apply(self, arguments);
    self.$loaded().then(function() {
    self.userImage = userImage;
    self.$save();
    });
    });

    If you are trying to do something else, you may need to provide
    details about the use case we're attempting to implement (usually a good
    starting point to save time and energy).

    Cheers,
    Kato



    On Tue, Dec 2, 2014 at 11:35 AM, Georges Boris <georgesboris@gmail.com
    wrote:
    I'll rephrase my question so it is more to the point.

    I'm getting an object like this from firebase:

    $groupId {
    picture: 'http://...",
    title: "group title"
    }

    I can add methods or other properties to it through
    $FirebaseObject.$extendFactory and it works great. But I when I try to
    overwrite one of the existing properties, the original property remains. Is
    there someway I could overwrite the picture property through $extendFactory
    or is this just not how this is supposed to work?

    something like:

    var userImage = userFactory.getUserImage();
    var groupFactory = $FirebaseObject.$extendFactory({
    picture: userImage
    });

    tks

    Em segunda-feira, 1 de dezembro de 2014 23h03min28s UTC-3, Georges
    Boris escreveu:
    I'm building an app for task and project management and the need for
    overwriting the stored properties of some objects (without actually
    changing the stored properties) appeared.
    To put it simple, I have some "group of tasks" objects that works as
    expected but there's a special group, a "personal group" which uses the
    current logged in user for dynamically changing itself.

    E.g.:
    When I show a group's dashboard page, there's a group's thumbnail
    image, which is stored normally in a "picture" property on firebase.
    But when I go to this personal group's dashboard, I want this
    picture to be replaced by the current user's picture, without replicating
    the url on the group/picture path every time the user changes its picture.

    When I try to use the $extendFactory, what appears to happen is that
    the property is overwritten by the downloaded properties (as they are
    downloaded from server after I extend the original object). I can be really
    off the mark here. But is there any way I can accomplish this? Or any
    reason why this is a bad idea and I should go the duplicating stuff path?

    Thanks.
    --
    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/5d095919-073d-4234-9ac5-8039aafad00a%40googlegroups.com
    <https://groups.google.com/d/msgid/firebase-angular/5d095919-073d-4234-9ac5-8039aafad00a%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 a topic in the
    Google Groups "Firebase + AngularJS" group.
    To unsubscribe from this topic, visit
    https://groups.google.com/d/topic/firebase-angular/FSynHvgSQJE/unsubscribe
    .
    To unsubscribe from this group and all its topics, 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/CADypTEaP%3DR4Gg8Vh-YkJ_fA5ZgM-s7mumk7zksPjRg%2Bpm0phkA%40mail.gmail.com
    <https://groups.google.com/d/msgid/firebase-angular/CADypTEaP%3DR4Gg8Vh-YkJ_fA5ZgM-s7mumk7zksPjRg%2Bpm0phkA%40mail.gmail.com?utm_medium=email&utm_source=footer>
    .

    For more options, visit https://groups.google.com/d/optout.


    --

    Georges Boris
    11 986 463 868

    --
    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/CAPyfT%2B__r%2Bid%3DKVWi7-b93rCQb0JUx1XPgr4hMARd9f8Xq9d3Q%40mail.gmail.com
    <https://groups.google.com/d/msgid/firebase-angular/CAPyfT%2B__r%2Bid%3DKVWi7-b93rCQb0JUx1XPgr4hMARd9f8Xq9d3Q%40mail.gmail.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 a topic in the
    Google Groups "Firebase + AngularJS" group.
    To unsubscribe from this topic, visit
    https://groups.google.com/d/topic/firebase-angular/FSynHvgSQJE/unsubscribe
    .
    To unsubscribe from this group and all its topics, 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/CAGcMwsDG%2Bf_AkgKhQy1Jjo-g2gvvjcxHRPxcaPohm9YUkJ%3D80A%40mail.gmail.com
    <https://groups.google.com/d/msgid/firebase-angular/CAGcMwsDG%2Bf_AkgKhQy1Jjo-g2gvvjcxHRPxcaPohm9YUkJ%3D80A%40mail.gmail.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/448A4C5B-6338-4250-B211-6589B0FA5EBF%40gmail.com
    <https://groups.google.com/d/msgid/firebase-angular/448A4C5B-6338-4250-B211-6589B0FA5EBF%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 a topic in the
    Google Groups "Firebase + AngularJS" group.
    To unsubscribe from this topic, visit
    https://groups.google.com/d/topic/firebase-angular/FSynHvgSQJE/unsubscribe
    .
    To unsubscribe from this group and all its topics, 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/CAGcMwsCYYqeFEicqn7QZiUDk-CUr5ANr3w7N_j0jWf-Bo%3DMbgw%40mail.gmail.com
    <https://groups.google.com/d/msgid/firebase-angular/CAGcMwsCYYqeFEicqn7QZiUDk-CUr5ANr3w7N_j0jWf-Bo%3DMbgw%40mail.gmail.com?utm_medium=email&utm_source=footer>
    .

    For more options, visit https://groups.google.com/d/optout.


    --

    Georges Boris
    11 986 463 868

    --
    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/CAPyfT%2B_Z4NQs2ABoZEVn6agODKg-f9WucwCHGx0WrYY8S%2BBr6A%40mail.gmail.com
    <https://groups.google.com/d/msgid/firebase-angular/CAPyfT%2B_Z4NQs2ABoZEVn6agODKg-f9WucwCHGx0WrYY8S%2BBr6A%40mail.gmail.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/CAGcMwsCDezPkCSvza%3Dy32bYWhWfv1FPJSaze1QRUxBt6zOg4LA%40mail.gmail.com.
    For more options, visit https://groups.google.com/d/optout.
  • Georges Boris at Dec 5, 2014 at 6:17 pm
    Geez it's really easy! Thanks a ton man. Cheers!

    (I had not began to look into it as Im focusing on the front-end right now but this will really speed up the proccess. Thank you)

    Enviado via meu smartphone
    Le 05/12/2014 à 15:11, Jacob Wenger <jacob@firebase.com> a écrit :

    Georges,

    You can easily fake this by sending the uid and provider of your logged-in user along with the request to your secure backend, say by putting them in the query string. Then, on the backend, use one of our token generator libraries to generate a custom auth token. While this may seem like a lot of work, it is actually extremely easy. Here is some pseudocode of how you would do it in Node.js:

    var FirebaseTokenGenerator = require("firebase-token-generator");
    var tokenGenerator = new FirebaseTokenGenerator("<YOUR_FIREBASE_SECRET>");
    var token = tokenGenerator.createToken({
    uid: req.query.uid,
    provider: req.query.provider
    });

    var ref = new Firebase("https://<YOUR-FIREBASE>.firebaseio.com");
    ref.authWithCustomToken(token, function(error, authData) {
    if (error === null) {
    // now you are authenticated with the same permissions as you had client-side
    } else {
    console.log("Error:", error);
    }
    });

    Jacob
    On Fri, Dec 5, 2014 at 3:01 AM, Georges Boris wrote:
    hey jacob, thanks for the feedback.

    great to hear about this new feature concerning this scenario!
    looking forward to see more of it! meanwhile I guess I'll continue with the development of a support backend for this types of situations. the only problem I get when developing this type of parallel processing is maintaining the authentication synced between both client and backend acting as client on firebase. but I guess I'm filling this thread with too many concerns.

    cheers!


    2014-12-05 4:10 GMT-03:00 Jacob Wenger <jacob@firebase.com>:
    Georges,

    You touch on great point about trusting the client to update all relevant places in your Firebase. It is true that a write to one place could succeed but the corresponding write to another place could fail. This could happen if your app is going on and offline. Thankfully, Firebase handles this situation pretty well and will eventually succeed in the write once you regain a connection. If your app never does regain that connection though, there is little we can do.

    To work around this, I would suggestion architecting your data in such a way that you can handle these edge cases. They are rare enough that most users won't be affected, but you want to make sure your app won't crash and burn if they do. If the writes are mission critical, I would make sure that you have a backend process that ensures both writes occur. For notifications, you should be fine writing to both places and if one out of every few thousand writes fail, it's probably not the end of the world.

    Another option you could have is to have some sort of cron job which runs regularly and makes sure all the data is correct. It can backfill in any data that for some reason did not complete properly.

    The good news for you is that we are actively working on this problem. We recently demoed a feature called Triggers which would allow you to write to one place and have us handle the fanout to other parts of your Firebase. It will allow you to easily flatten your data. That feature is not even in beta yet, but we are actively working on making it a reality!

    Jacob
    On Wed, Dec 3, 2014 at 3:36 AM, Georges Boris wrote:
    Tks jacob. Yeah, you're right. But that raises another question.

    How do you make interdependent changes like this one in a proper way with firebase? I feel like trusting the client for making multiple async operations is not the way to go. I was thinking about creating another back-end (like a node.js app) that would be in charge of making all these alterations to the firebase data that require multiple changes to effectly occur. Do you feel like that is a common approach when dealing with a front-end only enviroment like firebase or am I overthinking this as well?

    (I'm aware that the example mentioned about the thumbnail is really simple. But there are others that are more elaborate. Like creating notifications for all participants of a group based on a lot of different actions)

    Tks for the help

    Enviado via meu smartphone
    Le 03/12/2014 à 04:43, Jacob Wenger <jacob@firebase.com> a écrit :

    Hey Georges,

    Just to throw my two cents in here, I think you are overthinking the problem and should just go with the solution you mentioned in your first message: duplicate the data. Data duplication/bandwidth is so cheap and it would save you the effort of trying to extend the AngularFire factories. You are more than welcome to do so (as Kato pointed out), but if it was me, I would just store the image URL twice and be done with it.

    ​Jacob​

    On Tue, Dec 2, 2014 at 12:14 PM, Georges Boris wrote:
    the use case is as I've said...

    I have a group object on my app. Each group has a title + picture url as properties.
    There's one special group though, that is my user group, that has it's thumbnail picture linked to the user's current thumbnail.
    I could be saving the user's picture on the group every time there was a change but I felt like the cleanest solution would be to just use the user's picture directly... Overwriting the group's picture property.

    That been said I think the solution of saving the synced data to this.data might work. thanks.

    2014-12-02 16:37 GMT-03:00 Kato Richardson <wulf@firebase.com>:
    I don't really understand the problem here. This is a synchronized object and it should be expected that the local data will exactly match the remote data.

    If you want to specify a default value, use $$defaults. If you want to specify values that are not synchronized, then you'll need to try an approach like the gist I linked, which stores all the synchronized data in `this.data` instead of directly on `this`.

    If you are attempting to specify a value that should be saved to the server, then make sure it gets applied after the object is fully loaded:

    var userImage = userFactory.getUserImage();
    var groupFactory = $FirebaseObject.$extendFactory(function() {
    var self = this;
    $FirebaseObject.apply(self, arguments);
    self.$loaded().then(function() {
    self.userImage = userImage;
    self.$save();
    });
    });

    If you are trying to do something else, you may need to provide details about the use case we're attempting to implement (usually a good starting point to save time and energy).

    Cheers,
    Kato


    On Tue, Dec 2, 2014 at 11:35 AM, Georges Boris wrote:
    I'll rephrase my question so it is more to the point.

    I'm getting an object like this from firebase:

    $groupId {
    picture: 'http://...",
    title: "group title"
    }

    I can add methods or other properties to it through $FirebaseObject.$extendFactory and it works great. But I when I try to overwrite one of the existing properties, the original property remains. Is there someway I could overwrite the picture property through $extendFactory or is this just not how this is supposed to work?

    something like:

    var userImage = userFactory.getUserImage();
    var groupFactory = $FirebaseObject.$extendFactory({
    picture: userImage
    });

    tks
    Em segunda-feira, 1 de dezembro de 2014 23h03min28s UTC-3, Georges Boris escreveu:
    I'm building an app for task and project management and the need for overwriting the stored properties of some objects (without actually changing the stored properties) appeared.
    To put it simple, I have some "group of tasks" objects that works as expected but there's a special group, a "personal group" which uses the current logged in user for dynamically changing itself.

    E.g.:
    When I show a group's dashboard page, there's a group's thumbnail image, which is stored normally in a "picture" property on firebase.
    But when I go to this personal group's dashboard, I want this picture to be replaced by the current user's picture, without replicating the url on the group/picture path every time the user changes its picture.

    When I try to use the $extendFactory, what appears to happen is that the property is overwritten by the downloaded properties (as they are downloaded from server after I extend the original object). I can be really off the mark here. But is there any way I can accomplish this? Or any reason why this is a bad idea and I should go the duplicating stuff path?

    Thanks.
    --
    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/5d095919-073d-4234-9ac5-8039aafad00a%40googlegroups.com.

    For more options, visit https://groups.google.com/d/optout.
    --
    You received this message because you are subscribed to a topic in the Google Groups "Firebase + AngularJS" group.
    To unsubscribe from this topic, visit https://groups.google.com/d/topic/firebase-angular/FSynHvgSQJE/unsubscribe.
    To unsubscribe from this group and all its topics, 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/CADypTEaP%3DR4Gg8Vh-YkJ_fA5ZgM-s7mumk7zksPjRg%2Bpm0phkA%40mail.gmail.com.

    For more options, visit https://groups.google.com/d/optout.


    --

    Georges Boris
    11 986 463 868
    --
    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/CAPyfT%2B__r%2Bid%3DKVWi7-b93rCQb0JUx1XPgr4hMARd9f8Xq9d3Q%40mail.gmail.com.

    For more options, visit https://groups.google.com/d/optout.
    --
    You received this message because you are subscribed to a topic in the Google Groups "Firebase + AngularJS" group.
    To unsubscribe from this topic, visit https://groups.google.com/d/topic/firebase-angular/FSynHvgSQJE/unsubscribe.
    To unsubscribe from this group and all its topics, 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/CAGcMwsDG%2Bf_AkgKhQy1Jjo-g2gvvjcxHRPxcaPohm9YUkJ%3D80A%40mail.gmail.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/448A4C5B-6338-4250-B211-6589B0FA5EBF%40gmail.com.

    For more options, visit https://groups.google.com/d/optout.
    --
    You received this message because you are subscribed to a topic in the Google Groups "Firebase + AngularJS" group.
    To unsubscribe from this topic, visit https://groups.google.com/d/topic/firebase-angular/FSynHvgSQJE/unsubscribe.
    To unsubscribe from this group and all its topics, 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/CAGcMwsCYYqeFEicqn7QZiUDk-CUr5ANr3w7N_j0jWf-Bo%3DMbgw%40mail.gmail.com.

    For more options, visit https://groups.google.com/d/optout.


    --

    Georges Boris
    11 986 463 868
    --
    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/CAPyfT%2B_Z4NQs2ABoZEVn6agODKg-f9WucwCHGx0WrYY8S%2BBr6A%40mail.gmail.com.

    For more options, visit https://groups.google.com/d/optout.
    --
    You received this message because you are subscribed to a topic in the Google Groups "Firebase + AngularJS" group.
    To unsubscribe from this topic, visit https://groups.google.com/d/topic/firebase-angular/FSynHvgSQJE/unsubscribe.
    To unsubscribe from this group and all its topics, 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/CAGcMwsCDezPkCSvza%3Dy32bYWhWfv1FPJSaze1QRUxBt6zOg4LA%40mail.gmail.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/2A56A85E-DB30-4844-B46B-A27B852249CE%40gmail.com.
    For more options, visit https://groups.google.com/d/optout.
  • Kato Richardson at Dec 9, 2014 at 3:32 pm
    One gotcha here is that if you will be authenticating as multiple users
    asynchronously, then you will need a "context" to pass into the Firebase
    ref. Otherwise, each time that authWithCustomToken() is called, the
    existing listeners will be logged out and replaced with the new credentials.

    Jacob, do you know the syntax for that?
    On Fri, Dec 5, 2014 at 11:17 AM, Georges Boris wrote:

    Geez it's really easy! Thanks a ton man. Cheers!

    (I had not began to look into it as Im focusing on the front-end right now
    but this will really speed up the proccess. Thank you)

    Enviado via meu smartphone

    Le 05/12/2014 à 15:11, Jacob Wenger <jacob@firebase.com> a écrit :

    Georges,

    You can easily fake this by sending the uid and provider of your
    logged-in user along with the request to your secure backend, say by
    putting them in the query string. Then, on the backend, use one of our
    token generator libraries
    <https://www.firebase.com/docs/web/guide/login/custom.html#section-rest-token-helper-libraries>
    to generate a custom auth token. While this may seem like a lot of work, it
    is actually extremely easy. Here is some pseudocode of how you would do it
    in Node.js:

    var FirebaseTokenGenerator = require("firebase-token-generator");
    var tokenGenerator = new FirebaseTokenGenerator("<YOUR_FIREBASE_SECRET>");
    var token = tokenGenerator.createToken({
    uid: req.query.uid,
    provider: req.query.provider
    });

    var ref = new Firebase("https://<YOUR-FIREBASE>.firebaseio.com");
    ref.authWithCustomToken(token, function(error, authData) {
    if (error === null) {
    // now you are authenticated with the same permissions as you had
    client-side
    } else {
    console.log("Error:", error);
    }
    });

    Jacob
    On Fri, Dec 5, 2014 at 3:01 AM, Georges Boris wrote:

    hey jacob, thanks for the feedback.

    great to hear about this new feature concerning this scenario!
    looking forward to see more of it! meanwhile I guess I'll continue with
    the development of a support backend for this types of situations. the only
    problem I get when developing this type of parallel processing is
    maintaining the authentication synced between both client and backend
    acting as client on firebase. but I guess I'm filling this thread with too
    many concerns.

    cheers!


    2014-12-05 4:10 GMT-03:00 Jacob Wenger <jacob@firebase.com>:
    Georges,

    You touch on great point about trusting the client to update all
    relevant places in your Firebase. It is true that a write to one place
    could succeed but the corresponding write to another place could fail. This
    could happen if your app is going on and offline. Thankfully, Firebase
    handles this situation pretty well and will eventually succeed in the write
    once you regain a connection. If your app never does regain that connection
    though, there is little we can do.

    To work around this, I would suggestion architecting your data in such a
    way that you can handle these edge cases. They are rare enough that most
    users won't be affected, but you want to make sure your app won't crash and
    burn if they do. If the writes are mission critical, I would make sure that
    you have a backend process that ensures both writes occur. For
    notifications, you should be fine writing to both places and if one out of
    every few thousand writes fail, it's probably not the end of the world.

    Another option you could have is to have some sort of cron job which
    runs regularly and makes sure all the data is correct. It can backfill in
    any data that for some reason did not complete properly.

    The good news for you is that we are actively working on this problem.
    We recently demoed a feature called Triggers which would allow you to write
    to one place and have us handle the fanout to other parts of your Firebase.
    It will allow you to easily flatten your data. That feature is not even in
    beta yet, but we are actively working on making it a reality!

    Jacob

    On Wed, Dec 3, 2014 at 3:36 AM, Georges Boris <georgesboris@gmail.com>
    wrote:
    Tks jacob. Yeah, you're right. But that raises another question.

    How do you make interdependent changes like this one in a proper way
    with firebase? I feel like trusting the client for making multiple async
    operations is not the way to go. I was thinking about creating another
    back-end (like a node.js app) that would be in charge of making all these
    alterations to the firebase data that require multiple changes to effectly
    occur. Do you feel like that is a common approach when dealing with a
    front-end only enviroment like firebase or am I overthinking this as well?

    (I'm aware that the example mentioned about the thumbnail is really
    simple. But there are others that are more elaborate. Like creating
    notifications for all participants of a group based on a lot of different
    actions)

    Tks for the help

    Enviado via meu smartphone

    Le 03/12/2014 à 04:43, Jacob Wenger <jacob@firebase.com> a écrit :

    Hey Georges,

    Just to throw my two cents in here, I think you are overthinking the
    problem and should just go with the solution you mentioned in your first
    message: duplicate the data. Data duplication/bandwidth is so cheap and it
    would save you the effort of trying to extend the AngularFire factories.
    You are more than welcome to do so (as Kato pointed out), but if it was me,
    I would just store the image URL twice and be done with it.

    ​Jacob​


    On Tue, Dec 2, 2014 at 12:14 PM, Georges Boris <georgesboris@gmail.com>
    wrote:
    the use case is as I've said...

    I have a group object on my app. Each group has a title + picture url
    as properties.
    There's one special group though, that is my user group, that has it's
    thumbnail picture linked to the user's current thumbnail.
    I could be saving the user's picture on the group every time there was
    a change but I felt like the cleanest solution would be to just use the
    user's picture directly... Overwriting the group's picture property.

    That been said I think the solution of saving the synced data to
    this.data might work. thanks.

    2014-12-02 16:37 GMT-03:00 Kato Richardson <wulf@firebase.com>:
    I don't really understand the problem here. This is a synchronized
    object and it should be expected that the local data will exactly match the
    remote data.

    If you want to specify a default value, use $$defaults
    <https://www.firebase.com/docs/web/libraries/angular/guide.html#section-extending-factories>.
    If you want to specify values that are not synchronized, then you'll need
    to try an approach like the gist I linked, which stores all the
    synchronized data in `this.data` instead of directly on `this`.

    If you are attempting to specify a value that should be saved to the
    server, then make sure it gets applied after the object is fully loaded:

    var userImage = userFactory.getUserImage();
    var groupFactory = $FirebaseObject.$extendFactory(function() {
    var self = this;
    $FirebaseObject.apply(self, arguments);
    self.$loaded().then(function() {
    self.userImage = userImage;
    self.$save();
    });
    });

    If you are trying to do something else, you may need to provide
    details about the use case we're attempting to implement (usually a good
    starting point to save time and energy).

    Cheers,
    Kato



    On Tue, Dec 2, 2014 at 11:35 AM, Georges Boris <
    georgesboris@gmail.com> wrote:
    I'll rephrase my question so it is more to the point.

    I'm getting an object like this from firebase:

    $groupId {
    picture: 'http://...",
    title: "group title"
    }

    I can add methods or other properties to it through
    $FirebaseObject.$extendFactory and it works great. But I when I try to
    overwrite one of the existing properties, the original property remains. Is
    there someway I could overwrite the picture property through $extendFactory
    or is this just not how this is supposed to work?

    something like:

    var userImage = userFactory.getUserImage();
    var groupFactory = $FirebaseObject.$extendFactory({
    picture: userImage
    });

    tks

    Em segunda-feira, 1 de dezembro de 2014 23h03min28s UTC-3, Georges
    Boris escreveu:
    I'm building an app for task and project management and the need
    for overwriting the stored properties of some objects (without actually
    changing the stored properties) appeared.
    To put it simple, I have some "group of tasks" objects that works
    as expected but there's a special group, a "personal group" which uses the
    current logged in user for dynamically changing itself.

    E.g.:
    When I show a group's dashboard page, there's a group's thumbnail
    image, which is stored normally in a "picture" property on firebase.
    But when I go to this personal group's dashboard, I want this
    picture to be replaced by the current user's picture, without replicating
    the url on the group/picture path every time the user changes its picture.

    When I try to use the $extendFactory, what appears to happen is
    that the property is overwritten by the downloaded properties (as they are
    downloaded from server after I extend the original object). I can be really
    off the mark here. But is there any way I can accomplish this? Or any
    reason why this is a bad idea and I should go the duplicating stuff path?

    Thanks.
    --
    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/5d095919-073d-4234-9ac5-8039aafad00a%40googlegroups.com
    <https://groups.google.com/d/msgid/firebase-angular/5d095919-073d-4234-9ac5-8039aafad00a%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 a topic in
    the Google Groups "Firebase + AngularJS" group.
    To unsubscribe from this topic, visit
    https://groups.google.com/d/topic/firebase-angular/FSynHvgSQJE/unsubscribe
    .
    To unsubscribe from this group and all its topics, 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/CADypTEaP%3DR4Gg8Vh-YkJ_fA5ZgM-s7mumk7zksPjRg%2Bpm0phkA%40mail.gmail.com
    <https://groups.google.com/d/msgid/firebase-angular/CADypTEaP%3DR4Gg8Vh-YkJ_fA5ZgM-s7mumk7zksPjRg%2Bpm0phkA%40mail.gmail.com?utm_medium=email&utm_source=footer>
    .

    For more options, visit https://groups.google.com/d/optout.


    --

    Georges Boris
    11 986 463 868

    --
    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/CAPyfT%2B__r%2Bid%3DKVWi7-b93rCQb0JUx1XPgr4hMARd9f8Xq9d3Q%40mail.gmail.com
    <https://groups.google.com/d/msgid/firebase-angular/CAPyfT%2B__r%2Bid%3DKVWi7-b93rCQb0JUx1XPgr4hMARd9f8Xq9d3Q%40mail.gmail.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 a topic in the
    Google Groups "Firebase + AngularJS" group.
    To unsubscribe from this topic, visit
    https://groups.google.com/d/topic/firebase-angular/FSynHvgSQJE/unsubscribe
    .
    To unsubscribe from this group and all its topics, 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/CAGcMwsDG%2Bf_AkgKhQy1Jjo-g2gvvjcxHRPxcaPohm9YUkJ%3D80A%40mail.gmail.com
    <https://groups.google.com/d/msgid/firebase-angular/CAGcMwsDG%2Bf_AkgKhQy1Jjo-g2gvvjcxHRPxcaPohm9YUkJ%3D80A%40mail.gmail.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/448A4C5B-6338-4250-B211-6589B0FA5EBF%40gmail.com
    <https://groups.google.com/d/msgid/firebase-angular/448A4C5B-6338-4250-B211-6589B0FA5EBF%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 a topic in the
    Google Groups "Firebase + AngularJS" group.
    To unsubscribe from this topic, visit
    https://groups.google.com/d/topic/firebase-angular/FSynHvgSQJE/unsubscribe
    .
    To unsubscribe from this group and all its topics, 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/CAGcMwsCYYqeFEicqn7QZiUDk-CUr5ANr3w7N_j0jWf-Bo%3DMbgw%40mail.gmail.com
    <https://groups.google.com/d/msgid/firebase-angular/CAGcMwsCYYqeFEicqn7QZiUDk-CUr5ANr3w7N_j0jWf-Bo%3DMbgw%40mail.gmail.com?utm_medium=email&utm_source=footer>
    .

    For more options, visit https://groups.google.com/d/optout.


    --

    Georges Boris
    11 986 463 868

    --
    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/CAPyfT%2B_Z4NQs2ABoZEVn6agODKg-f9WucwCHGx0WrYY8S%2BBr6A%40mail.gmail.com
    <https://groups.google.com/d/msgid/firebase-angular/CAPyfT%2B_Z4NQs2ABoZEVn6agODKg-f9WucwCHGx0WrYY8S%2BBr6A%40mail.gmail.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 a topic in the
    Google Groups "Firebase + AngularJS" group.
    To unsubscribe from this topic, visit
    https://groups.google.com/d/topic/firebase-angular/FSynHvgSQJE/unsubscribe
    .
    To unsubscribe from this group and all its topics, 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/CAGcMwsCDezPkCSvza%3Dy32bYWhWfv1FPJSaze1QRUxBt6zOg4LA%40mail.gmail.com
    <https://groups.google.com/d/msgid/firebase-angular/CAGcMwsCDezPkCSvza%3Dy32bYWhWfv1FPJSaze1QRUxBt6zOg4LA%40mail.gmail.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/2A56A85E-DB30-4844-B46B-A27B852249CE%40gmail.com
    <https://groups.google.com/d/msgid/firebase-angular/2A56A85E-DB30-4844-B46B-A27B852249CE%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/CADypTEbjm4UKKj3P%3DjrdSN1iUqdVEUKy_pb-Zop6C40z30K8JA%40mail.gmail.com.
    For more options, visit https://groups.google.com/d/optout.
  • Jacob Wenger at Dec 9, 2014 at 3:38 pm
    The context is a string that is passed as a second argument when creating
    the reference:

    new Firebase("https://<your-firebase>.firebaseio.com", context);

    Each new Firebase ref will then be able to be authenticated separately.
    However, this is an undocumented feature and could be changed unexpectedly,
    so just be cautious while using it.

    Jacob
    On Tue, Dec 9, 2014 at 7:32 AM, Kato Richardson wrote:

    One gotcha here is that if you will be authenticating as multiple users
    asynchronously, then you will need a "context" to pass into the Firebase
    ref. Otherwise, each time that authWithCustomToken() is called, the
    existing listeners will be logged out and replaced with the new credentials.

    Jacob, do you know the syntax for that?
    On Fri, Dec 5, 2014 at 11:17 AM, Georges Boris wrote:

    Geez it's really easy! Thanks a ton man. Cheers!

    (I had not began to look into it as Im focusing on the front-end right
    now but this will really speed up the proccess. Thank you)

    Enviado via meu smartphone

    Le 05/12/2014 à 15:11, Jacob Wenger <jacob@firebase.com> a écrit :

    Georges,

    You can easily fake this by sending the uid and provider of your
    logged-in user along with the request to your secure backend, say by
    putting them in the query string. Then, on the backend, use one of our
    token generator libraries
    <https://www.firebase.com/docs/web/guide/login/custom.html#section-rest-token-helper-libraries>
    to generate a custom auth token. While this may seem like a lot of work, it
    is actually extremely easy. Here is some pseudocode of how you would do it
    in Node.js:

    var FirebaseTokenGenerator = require("firebase-token-generator");
    var tokenGenerator = new FirebaseTokenGenerator("<YOUR_FIREBASE_SECRET>");
    var token = tokenGenerator.createToken({
    uid: req.query.uid,
    provider: req.query.provider
    });

    var ref = new Firebase("https://<YOUR-FIREBASE>.firebaseio.com");
    ref.authWithCustomToken(token, function(error, authData) {
    if (error === null) {
    // now you are authenticated with the same permissions as you had
    client-side
    } else {
    console.log("Error:", error);
    }
    });

    Jacob

    On Fri, Dec 5, 2014 at 3:01 AM, Georges Boris <georgesboris@gmail.com>
    wrote:
    hey jacob, thanks for the feedback.

    great to hear about this new feature concerning this scenario!
    looking forward to see more of it! meanwhile I guess I'll continue with
    the development of a support backend for this types of situations. the only
    problem I get when developing this type of parallel processing is
    maintaining the authentication synced between both client and backend
    acting as client on firebase. but I guess I'm filling this thread with too
    many concerns.

    cheers!


    2014-12-05 4:10 GMT-03:00 Jacob Wenger <jacob@firebase.com>:
    Georges,

    You touch on great point about trusting the client to update all
    relevant places in your Firebase. It is true that a write to one place
    could succeed but the corresponding write to another place could fail. This
    could happen if your app is going on and offline. Thankfully, Firebase
    handles this situation pretty well and will eventually succeed in the write
    once you regain a connection. If your app never does regain that connection
    though, there is little we can do.

    To work around this, I would suggestion architecting your data in such
    a way that you can handle these edge cases. They are rare enough that most
    users won't be affected, but you want to make sure your app won't crash and
    burn if they do. If the writes are mission critical, I would make sure that
    you have a backend process that ensures both writes occur. For
    notifications, you should be fine writing to both places and if one out of
    every few thousand writes fail, it's probably not the end of the world.

    Another option you could have is to have some sort of cron job which
    runs regularly and makes sure all the data is correct. It can backfill in
    any data that for some reason did not complete properly.

    The good news for you is that we are actively working on this problem.
    We recently demoed a feature called Triggers which would allow you to write
    to one place and have us handle the fanout to other parts of your Firebase.
    It will allow you to easily flatten your data. That feature is not even in
    beta yet, but we are actively working on making it a reality!

    Jacob

    On Wed, Dec 3, 2014 at 3:36 AM, Georges Boris <georgesboris@gmail.com>
    wrote:
    Tks jacob. Yeah, you're right. But that raises another question.

    How do you make interdependent changes like this one in a proper way
    with firebase? I feel like trusting the client for making multiple async
    operations is not the way to go. I was thinking about creating another
    back-end (like a node.js app) that would be in charge of making all these
    alterations to the firebase data that require multiple changes to effectly
    occur. Do you feel like that is a common approach when dealing with a
    front-end only enviroment like firebase or am I overthinking this as well?

    (I'm aware that the example mentioned about the thumbnail is really
    simple. But there are others that are more elaborate. Like creating
    notifications for all participants of a group based on a lot of different
    actions)

    Tks for the help

    Enviado via meu smartphone

    Le 03/12/2014 à 04:43, Jacob Wenger <jacob@firebase.com> a écrit :

    Hey Georges,

    Just to throw my two cents in here, I think you are overthinking the
    problem and should just go with the solution you mentioned in your first
    message: duplicate the data. Data duplication/bandwidth is so cheap and it
    would save you the effort of trying to extend the AngularFire factories.
    You are more than welcome to do so (as Kato pointed out), but if it was me,
    I would just store the image URL twice and be done with it.

    ​Jacob​


    On Tue, Dec 2, 2014 at 12:14 PM, Georges Boris <georgesboris@gmail.com
    wrote:
    the use case is as I've said...

    I have a group object on my app. Each group has a title + picture url
    as properties.
    There's one special group though, that is my user group, that has
    it's thumbnail picture linked to the user's current thumbnail.
    I could be saving the user's picture on the group every time there
    was a change but I felt like the cleanest solution would be to just use the
    user's picture directly... Overwriting the group's picture property.

    That been said I think the solution of saving the synced data to
    this.data might work. thanks.

    2014-12-02 16:37 GMT-03:00 Kato Richardson <wulf@firebase.com>:
    I don't really understand the problem here. This is a synchronized
    object and it should be expected that the local data will exactly match the
    remote data.

    If you want to specify a default value, use $$defaults
    <https://www.firebase.com/docs/web/libraries/angular/guide.html#section-extending-factories>.
    If you want to specify values that are not synchronized, then you'll need
    to try an approach like the gist I linked, which stores all the
    synchronized data in `this.data` instead of directly on `this`.

    If you are attempting to specify a value that should be saved to the
    server, then make sure it gets applied after the object is fully loaded:

    var userImage = userFactory.getUserImage();
    var groupFactory = $FirebaseObject.$extendFactory(function() {
    var self = this;
    $FirebaseObject.apply(self, arguments);
    self.$loaded().then(function() {
    self.userImage = userImage;
    self.$save();
    });
    });

    If you are trying to do something else, you may need to provide
    details about the use case we're attempting to implement (usually a good
    starting point to save time and energy).

    Cheers,
    Kato



    On Tue, Dec 2, 2014 at 11:35 AM, Georges Boris <
    georgesboris@gmail.com> wrote:
    I'll rephrase my question so it is more to the point.

    I'm getting an object like this from firebase:

    $groupId {
    picture: 'http://...",
    title: "group title"
    }

    I can add methods or other properties to it through
    $FirebaseObject.$extendFactory and it works great. But I when I try to
    overwrite one of the existing properties, the original property remains. Is
    there someway I could overwrite the picture property through $extendFactory
    or is this just not how this is supposed to work?

    something like:

    var userImage = userFactory.getUserImage();
    var groupFactory = $FirebaseObject.$extendFactory({
    picture: userImage
    });

    tks

    Em segunda-feira, 1 de dezembro de 2014 23h03min28s UTC-3, Georges
    Boris escreveu:
    I'm building an app for task and project management and the need
    for overwriting the stored properties of some objects (without actually
    changing the stored properties) appeared.
    To put it simple, I have some "group of tasks" objects that works
    as expected but there's a special group, a "personal group" which uses the
    current logged in user for dynamically changing itself.

    E.g.:
    When I show a group's dashboard page, there's a group's thumbnail
    image, which is stored normally in a "picture" property on firebase.
    But when I go to this personal group's dashboard, I want this
    picture to be replaced by the current user's picture, without replicating
    the url on the group/picture path every time the user changes its picture.

    When I try to use the $extendFactory, what appears to happen is
    that the property is overwritten by the downloaded properties (as they are
    downloaded from server after I extend the original object). I can be really
    off the mark here. But is there any way I can accomplish this? Or any
    reason why this is a bad idea and I should go the duplicating stuff path?

    Thanks.
    --
    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/5d095919-073d-4234-9ac5-8039aafad00a%40googlegroups.com
    <https://groups.google.com/d/msgid/firebase-angular/5d095919-073d-4234-9ac5-8039aafad00a%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 a topic in
    the Google Groups "Firebase + AngularJS" group.
    To unsubscribe from this topic, visit
    https://groups.google.com/d/topic/firebase-angular/FSynHvgSQJE/unsubscribe
    .
    To unsubscribe from this group and all its topics, 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/CADypTEaP%3DR4Gg8Vh-YkJ_fA5ZgM-s7mumk7zksPjRg%2Bpm0phkA%40mail.gmail.com
    <https://groups.google.com/d/msgid/firebase-angular/CADypTEaP%3DR4Gg8Vh-YkJ_fA5ZgM-s7mumk7zksPjRg%2Bpm0phkA%40mail.gmail.com?utm_medium=email&utm_source=footer>
    .

    For more options, visit https://groups.google.com/d/optout.


    --

    Georges Boris
    11 986 463 868

    --
    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/CAPyfT%2B__r%2Bid%3DKVWi7-b93rCQb0JUx1XPgr4hMARd9f8Xq9d3Q%40mail.gmail.com
    <https://groups.google.com/d/msgid/firebase-angular/CAPyfT%2B__r%2Bid%3DKVWi7-b93rCQb0JUx1XPgr4hMARd9f8Xq9d3Q%40mail.gmail.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 a topic in the
    Google Groups "Firebase + AngularJS" group.
    To unsubscribe from this topic, visit
    https://groups.google.com/d/topic/firebase-angular/FSynHvgSQJE/unsubscribe
    .
    To unsubscribe from this group and all its topics, 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/CAGcMwsDG%2Bf_AkgKhQy1Jjo-g2gvvjcxHRPxcaPohm9YUkJ%3D80A%40mail.gmail.com
    <https://groups.google.com/d/msgid/firebase-angular/CAGcMwsDG%2Bf_AkgKhQy1Jjo-g2gvvjcxHRPxcaPohm9YUkJ%3D80A%40mail.gmail.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/448A4C5B-6338-4250-B211-6589B0FA5EBF%40gmail.com
    <https://groups.google.com/d/msgid/firebase-angular/448A4C5B-6338-4250-B211-6589B0FA5EBF%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 a topic in the
    Google Groups "Firebase + AngularJS" group.
    To unsubscribe from this topic, visit
    https://groups.google.com/d/topic/firebase-angular/FSynHvgSQJE/unsubscribe
    .
    To unsubscribe from this group and all its topics, 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/CAGcMwsCYYqeFEicqn7QZiUDk-CUr5ANr3w7N_j0jWf-Bo%3DMbgw%40mail.gmail.com
    <https://groups.google.com/d/msgid/firebase-angular/CAGcMwsCYYqeFEicqn7QZiUDk-CUr5ANr3w7N_j0jWf-Bo%3DMbgw%40mail.gmail.com?utm_medium=email&utm_source=footer>
    .

    For more options, visit https://groups.google.com/d/optout.


    --

    Georges Boris
    11 986 463 868

    --
    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/CAPyfT%2B_Z4NQs2ABoZEVn6agODKg-f9WucwCHGx0WrYY8S%2BBr6A%40mail.gmail.com
    <https://groups.google.com/d/msgid/firebase-angular/CAPyfT%2B_Z4NQs2ABoZEVn6agODKg-f9WucwCHGx0WrYY8S%2BBr6A%40mail.gmail.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 a topic in the
    Google Groups "Firebase + AngularJS" group.
    To unsubscribe from this topic, visit
    https://groups.google.com/d/topic/firebase-angular/FSynHvgSQJE/unsubscribe
    .
    To unsubscribe from this group and all its topics, 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/CAGcMwsCDezPkCSvza%3Dy32bYWhWfv1FPJSaze1QRUxBt6zOg4LA%40mail.gmail.com
    <https://groups.google.com/d/msgid/firebase-angular/CAGcMwsCDezPkCSvza%3Dy32bYWhWfv1FPJSaze1QRUxBt6zOg4LA%40mail.gmail.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/2A56A85E-DB30-4844-B46B-A27B852249CE%40gmail.com
    <https://groups.google.com/d/msgid/firebase-angular/2A56A85E-DB30-4844-B46B-A27B852249CE%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/CADypTEbjm4UKKj3P%3DjrdSN1iUqdVEUKy_pb-Zop6C40z30K8JA%40mail.gmail.com
    <https://groups.google.com/d/msgid/firebase-angular/CADypTEbjm4UKKj3P%3DjrdSN1iUqdVEUKy_pb-Zop6C40z30K8JA%40mail.gmail.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/CAGcMwsBhWRzu7bk%3DmnmUwjVXx9bzgL%3DGuCY_GZTKP_wr57w5RQ%40mail.gmail.com.
    For more options, visit https://groups.google.com/d/optout.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupfirebase-angular @
postedDec 2, '14 at 2:03a
activeDec 9, '14 at 3:38p
posts12
users3

People

Translate

site design / logo © 2021 Grokbase