I have a number of factories that need to reference data in other firebase
locations. For example, an 'item' referencing the name of the box the item
is in.

On the item record I have the boxId and I have in the past setup a custom
object that the firebase array used and overrode the $$added, $$updated
calls to reference the customer ItemObject which had its own decorator
functions to retrieve the referenced data.

I have recently been exploring the $$defaults feature as an alternate
approach. Having to setup a custom object each time and manage $$added,
$$updated as well as the construction of the custom object itself is quite
an overhead. The $$defaults makes it very simple to add static data and
from what i can see I can also use this to add functions to the object.
However, I can't seem to work out a way to then use this to extract data
from other firebase locations to decorate the object with further
properties.

Is the $$defaults a good thing to use for this or am I wasting my time
looking at this?

--
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/c9715486-0bb7-40ee-8d4e-7daf152be8e4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Search Discussions

  • Kato Richardson at Feb 20, 2015 at 9:37 pm
    Phil,

    You won't be able to get $$defaults for loading dynamic data. Using the
    $extend approach seems like the way to go. I haven't had any performance
    issues or noticeable overhead here, unless you simply mean the additional
    coding effort of overriding the methods.

    Cheers,
    Kato



    On Fri, Feb 20, 2015 at 5:28 AM, Phil Hodey wrote:

    I have a number of factories that need to reference data in other firebase
    locations. For example, an 'item' referencing the name of the box the item
    is in.

    On the item record I have the boxId and I have in the past setup a custom
    object that the firebase array used and overrode the $$added, $$updated
    calls to reference the customer ItemObject which had its own decorator
    functions to retrieve the referenced data.

    I have recently been exploring the $$defaults feature as an alternate
    approach. Having to setup a custom object each time and manage $$added,
    $$updated as well as the construction of the custom object itself is quite
    an overhead. The $$defaults makes it very simple to add static data and
    from what i can see I can also use this to add functions to the object.
    However, I can't seem to work out a way to then use this to extract data
    from other firebase locations to decorate the object with further
    properties.

    Is the $$defaults a good thing to use for this or am I wasting my time
    looking at this?

    --
    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/c9715486-0bb7-40ee-8d4e-7daf152be8e4%40googlegroups.com
    <https://groups.google.com/d/msgid/firebase-angular/c9715486-0bb7-40ee-8d4e-7daf152be8e4%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/CADypTEY6pqDufh7m_LT5wXufF_JoGMq7e0OFwgORPNfgMxJT2w%40mail.gmail.com.
    For more options, visit https://groups.google.com/d/optout.
  • Phil Hodey at Feb 21, 2015 at 7:49 am
    Cheers Kato,

    No performance worries for me, it is purely a coding effort. The app I'm
    building has circa 45 different factories, extending each one and adding
    custom $$added, $$updated on the array and constructors/update methods just
    feels like a lot of code to add just to get a few lookup values into the
    object. Given what is coming up in v1.0.0 of angularFire I see a lot of
    refactoring coming up to support the first production version.

    Regards

    Phil



    On Friday, 20 February 2015 21:37:02 UTC, Michael Kato Wulf wrote:

    Phil,

    You won't be able to get $$defaults for loading dynamic data. Using the
    $extend approach seems like the way to go. I haven't had any performance
    issues or noticeable overhead here, unless you simply mean the additional
    coding effort of overriding the methods.

    Cheers,
    Kato




    On Fri, Feb 20, 2015 at 5:28 AM, Phil Hodey <phil....@hcstech.co.uk
    <javascript:>> wrote:
    I have a number of factories that need to reference data in other
    firebase locations. For example, an 'item' referencing the name of the box
    the item is in.

    On the item record I have the boxId and I have in the past setup a custom
    object that the firebase array used and overrode the $$added, $$updated
    calls to reference the customer ItemObject which had its own decorator
    functions to retrieve the referenced data.

    I have recently been exploring the $$defaults feature as an alternate
    approach. Having to setup a custom object each time and manage $$added,
    $$updated as well as the construction of the custom object itself is quite
    an overhead. The $$defaults makes it very simple to add static data and
    from what i can see I can also use this to add functions to the object.
    However, I can't seem to work out a way to then use this to extract data
    from other firebase locations to decorate the object with further
    properties.

    Is the $$defaults a good thing to use for this or am I wasting my time
    looking at this?

    --
    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-angul...@googlegroups.com <javascript:>.
    To post to this group, send email to firebase...@googlegroups.com
    <javascript:>.
    To view this discussion on the web visit
    https://groups.google.com/d/msgid/firebase-angular/c9715486-0bb7-40ee-8d4e-7daf152be8e4%40googlegroups.com
    <https://groups.google.com/d/msgid/firebase-angular/c9715486-0bb7-40ee-8d4e-7daf152be8e4%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/4a1cb12f-753f-48e3-8f43-b609534bb90f%40googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupfirebase-angular @
postedFeb 20, '15 at 12:28p
activeFeb 21, '15 at 7:49a
posts3
users2

2 users in discussion

Phil Hodey: 2 posts Kato Richardson: 1 post

People

Translate

site design / logo © 2021 Grokbase