FAQ
I have some questions about how $firebase works.

Taking this super simple controller for example:

var app = angular.module("app", ['firebase']);


app.constant('FBURL', 'https://groupstest.firebaseio.com/');


app.controller("ApplicationController", [
   '$scope',
   '$firebase',
   'FBURL',
   function($scope, $firebase, FBURL) {
     var groups = $firebase(new Firebase(FBURL + 'groups'));
     $scope.groups = groups;
   }]);

Given that the above code is all I need in order to be able to iterate over
the groups in my Firebase DB using ng-repeat....


    1. Does doing: $firebase(new Firebase(FBURL + 'groups')).$child("2"); load
    all groups before accessing the child or does it only load data associated
    with the child node?
    2. What about: $firebase(new Firebase(FBURL + 'groups/2')); Is that the
    same or different to the line above?

Finally as a bonus question ;-) .... If I do this:

$firebase(new Firebase(FBURL + 'groups/1'));
$firebase(new Firebase(FBURL + 'groups/2'));
$firebase(new Firebase(FBURL + 'groups/3'));

How many Firebase connections do I now have open? 1 or 3? Is this an
inefficient thing to do?

It's possible I'm not fully understanding how websockets works so my
apologies if that is the case. I'm used to a more traditional HTTP API
setup.

--
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/c881a2ce-b2a5-4011-bb6c-168c2df4ea38%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Search Discussions

  • Jacob Wenger at Jul 3, 2014 at 1:03 am
    Hey David,

    Great questions! You've entered into some interesting technical territory.
    But I do have answers for you:

    As soon as you do $firebase(firebaseRef), AngularFire loads *ALL OF THE
    DATA* at firebaseRef (whoops!). The same thing happens every time you use
    $child as well. So doing
    $firebase(firebaseRef).$child("users").$child("user10").$child("firstName")
    is *significantly* *less performant* than
    $firebase(firebaseRef.child("users").child("user10").child("firstName")).
    You should always use the latter.

    We realized this is not very clear and caused a lot of trouble for people.
    So - in our upcoming AngularFire 0.8 release - this will be fixed. Using
    $firebase() and $child() will be just as performant as making regular
    Firebase refs. You can access this code now if you'd like
    <https://github.com/firebase/angularFire/tree/release_0.8>, but it may
    still be a bit unstable. The docs for it are here
    <https://github.com/firebase/angularFire/blob/gh-pages/documentation.md>.
    It should be released in a week or two. If you do end up using it, let us
    know if you find any bugs!

    As for your bonus question, make as many Firebase refs as you'd like
    without worrying about performance! They are extremely cheap to make and
    they all use the same websocket to send and receive data.

    Let me know if you've still got questions.
    Jacob
    On Wednesday, July 2, 2014 8:42:00 AM UTC-7, David Tuite wrote:



    I have some questions about how $firebase works.

    Taking this super simple controller for example:

    var app = angular.module("app", ['firebase']);


    app.constant('FBURL', 'https://groupstest.firebaseio.com/');


    app.controller("ApplicationController", [
    '$scope',
    '$firebase',
    'FBURL',
    function($scope, $firebase, FBURL) {
    var groups = $firebase(new Firebase(FBURL + 'groups'));
    $scope.groups = groups;
    }]);

    Given that the above code is all I need in order to be able to iterate
    over the groups in my Firebase DB using ng-repeat....


    1. Does doing: $firebase(new Firebase(FBURL + 'groups')).$child("2"); load
    all groups before accessing the child or does it only load data associated
    with the child node?
    2. What about: $firebase(new Firebase(FBURL + 'groups/2')); Is that
    the same or different to the line above?

    Finally as a bonus question ;-) .... If I do this:

    $firebase(new Firebase(FBURL + 'groups/1'));
    $firebase(new Firebase(FBURL + 'groups/2'));
    $firebase(new Firebase(FBURL + 'groups/3'));

    How many Firebase connections do I now have open? 1 or 3? Is this an
    inefficient thing to do?

    It's possible I'm not fully understanding how websockets works so my
    apologies if that is the case. I'm used to a more traditional HTTP API
    setup.
    --
    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/7684a90a-494b-4253-9450-25476e7f2600%40googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
  • Jacob Wenger at Jul 3, 2014 at 1:21 am
    I mis-typed one thing. We completely removed $child from AngularFire 0.8.
    You should just revert to using the child() method provided by Firebase
    itself.
    On Wednesday, July 2, 2014 6:03:41 PM UTC-7, Jacob Wenger wrote:

    Hey David,

    Great questions! You've entered into some interesting technical territory.
    But I do have answers for you:

    As soon as you do $firebase(firebaseRef), AngularFire loads *ALL OF THE
    DATA* at firebaseRef (whoops!). The same thing happens every time you use
    $child as well. So doing
    $firebase(firebaseRef).$child("users").$child("user10").$child("firstName")
    is *significantly* *less performant* than
    $firebase(firebaseRef.child("users").child("user10").child("firstName")).
    You should always use the latter.

    We realized this is not very clear and caused a lot of trouble for people.
    So - in our upcoming AngularFire 0.8 release - this will be fixed. Using
    $firebase() and $child() will be just as performant as making regular
    Firebase refs. You can access this code now if you'd like
    <https://github.com/firebase/angularFire/tree/release_0.8>, but it may
    still be a bit unstable. The docs for it are here
    <https://github.com/firebase/angularFire/blob/gh-pages/documentation.md>.
    It should be released in a week or two. If you do end up using it, let us
    know if you find any bugs!

    As for your bonus question, make as many Firebase refs as you'd like
    without worrying about performance! They are extremely cheap to make and
    they all use the same websocket to send and receive data.

    Let me know if you've still got questions.
    Jacob
    On Wednesday, July 2, 2014 8:42:00 AM UTC-7, David Tuite wrote:



    I have some questions about how $firebase works.

    Taking this super simple controller for example:

    var app = angular.module("app", ['firebase']);


    app.constant('FBURL', 'https://groupstest.firebaseio.com/');


    app.controller("ApplicationController", [
    '$scope',
    '$firebase',
    'FBURL',
    function($scope, $firebase, FBURL) {
    var groups = $firebase(new Firebase(FBURL + 'groups'));
    $scope.groups = groups;
    }]);

    Given that the above code is all I need in order to be able to iterate
    over the groups in my Firebase DB using ng-repeat....


    1. Does doing: $firebase(new Firebase(FBURL + 'groups')).$child("2");
    load all groups before accessing the child or does it only load data
    associated with the child node?
    2. What about: $firebase(new Firebase(FBURL + 'groups/2')); Is that
    the same or different to the line above?

    Finally as a bonus question ;-) .... If I do this:

    $firebase(new Firebase(FBURL + 'groups/1'));
    $firebase(new Firebase(FBURL + 'groups/2'));
    $firebase(new Firebase(FBURL + 'groups/3'));

    How many Firebase connections do I now have open? 1 or 3? Is this an
    inefficient thing to do?

    It's possible I'm not fully understanding how websockets works so my
    apologies if that is the case. I'm used to a more traditional HTTP API
    setup.
    --
    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/a45c6921-956c-4a15-aeb9-f80ee9d39f52%40googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
  • Peter Jin at Jul 8, 2014 at 8:15 pm
    Jacob, is there a specific reason why *$child() *is being deprecated in 0.8?
    On Wednesday, July 2, 2014 9:21:19 PM UTC-4, Jacob Wenger wrote:

    I mis-typed one thing. We completely removed $child from AngularFire 0.8.
    You should just revert to using the child() method provided by Firebase
    itself.
    On Wednesday, July 2, 2014 6:03:41 PM UTC-7, Jacob Wenger wrote:

    Hey David,

    Great questions! You've entered into some interesting technical
    territory. But I do have answers for you:

    As soon as you do $firebase(firebaseRef), AngularFire loads *ALL OF THE
    DATA* at firebaseRef (whoops!). The same thing happens every time you
    use $child as well. So doing
    $firebase(firebaseRef).$child("users").$child("user10").$child("firstName")
    is *significantly* *less performant* than
    $firebase(firebaseRef.child("users").child("user10").child("firstName")).
    You should always use the latter.

    We realized this is not very clear and caused a lot of trouble for
    people. So - in our upcoming AngularFire 0.8 release - this will be fixed.
    Using $firebase() and $child() will be just as performant as making
    regular Firebase refs. You can access this code now if you'd like
    <https://github.com/firebase/angularFire/tree/release_0.8>, but it may
    still be a bit unstable. The docs for it are here
    <https://github.com/firebase/angularFire/blob/gh-pages/documentation.md>.
    It should be released in a week or two. If you do end up using it, let us
    know if you find any bugs!

    As for your bonus question, make as many Firebase refs as you'd like
    without worrying about performance! They are extremely cheap to make and
    they all use the same websocket to send and receive data.

    Let me know if you've still got questions.
    Jacob
    On Wednesday, July 2, 2014 8:42:00 AM UTC-7, David Tuite wrote:



    I have some questions about how $firebase works.

    Taking this super simple controller for example:

    var app = angular.module("app", ['firebase']);


    app.constant('FBURL', 'https://groupstest.firebaseio.com/');


    app.controller("ApplicationController", [
    '$scope',
    '$firebase',
    'FBURL',
    function($scope, $firebase, FBURL) {
    var groups = $firebase(new Firebase(FBURL + 'groups'));
    $scope.groups = groups;
    }]);

    Given that the above code is all I need in order to be able to iterate
    over the groups in my Firebase DB using ng-repeat....


    1. Does doing: $firebase(new Firebase(FBURL + 'groups')).$child("2");
    load all groups before accessing the child or does it only load
    data associated with the child node?
    2. What about: $firebase(new Firebase(FBURL + 'groups/2')); Is that
    the same or different to the line above?

    Finally as a bonus question ;-) .... If I do this:

    $firebase(new Firebase(FBURL + 'groups/1'));
    $firebase(new Firebase(FBURL + 'groups/2'));
    $firebase(new Firebase(FBURL + 'groups/3'));

    How many Firebase connections do I now have open? 1 or 3? Is this an
    inefficient thing to do?

    It's possible I'm not fully understanding how websockets works so my
    apologies if that is the case. I'm used to a more traditional HTTP API
    setup.
    --
    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/43220bb1-1831-461e-ab65-df95d12bc3d1%40googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
  • Michael Wulf at Jul 8, 2014 at 8:22 pm
    Hi Peter,

    AngularFire is designed to be a bindings tool, for simplifying interactions
    with a collection of data or a single record. We want to discourage using
    it as a wrapper on the Firebase API, and avoid trying to re-implement every
    Firebase method in AngularFire.

    Additionally, since all the data of every child already exists once you
    download the parent path, we want to encourage just using the existing data
    in the parent, rather than utilizing $child() to create additional copies
    in memory.

    You can still obtain child references indirectly in 0.8, but this is
    discouraged. Generally if you're having to manipulate the data yourself,
    you should a) extend the new factories in 0.8 to create a useful service or
    b) go right to the source and use Firebase directly, which will be more
    efficient.

    Feel free to email me directly with details of your use case if you feel
    this is the wrong approach. We would love the feedback!

    Cheers,
    Kato



    On Tue, Jul 8, 2014 at 1:00 PM, Peter Jin wrote:

    Jacob, is there a specific reason why *$child() *is being deprecated in
    0.8?

    On Wednesday, July 2, 2014 9:21:19 PM UTC-4, Jacob Wenger wrote:

    I mis-typed one thing. We completely removed $child from AngularFire
    0.8. You should just revert to using the child() method provided by
    Firebase itself.
    On Wednesday, July 2, 2014 6:03:41 PM UTC-7, Jacob Wenger wrote:

    Hey David,

    Great questions! You've entered into some interesting technical
    territory. But I do have answers for you:

    As soon as you do $firebase(firebaseRef), AngularFire loads *ALL OF THE
    DATA* at firebaseRef (whoops!). The same thing happens every time you
    use $child as well. So doing $firebase(firebaseRef).$child(
    "users").$child("user10").$child("firstName") is *significantly* *less
    performant* than $firebase(firebaseRef.child("
    users").child("user10").child("firstName")). You should always use the
    latter.

    We realized this is not very clear and caused a lot of trouble for
    people. So - in our upcoming AngularFire 0.8 release - this will be fixed.
    Using $firebase() and $child() will be just as performant as making
    regular Firebase refs. You can access this code now if you'd like
    <https://github.com/firebase/angularFire/tree/release_0.8>, but it may
    still be a bit unstable. The docs for it are here
    <https://github.com/firebase/angularFire/blob/gh-pages/documentation.md>.
    It should be released in a week or two. If you do end up using it, let us
    know if you find any bugs!

    As for your bonus question, make as many Firebase refs as you'd like
    without worrying about performance! They are extremely cheap to make and
    they all use the same websocket to send and receive data.

    Let me know if you've still got questions.
    Jacob
    On Wednesday, July 2, 2014 8:42:00 AM UTC-7, David Tuite wrote:



    I have some questions about how $firebase works.

    Taking this super simple controller for example:

    var app = angular.module("app", ['firebase']);


    app.constant('FBURL', 'https://groupstest.firebaseio.com/');


    app.controller("ApplicationController", [
    '$scope',
    '$firebase',
    'FBURL',
    function($scope, $firebase, FBURL) {
    var groups = $firebase(new Firebase(FBURL + 'groups'));
    $scope.groups = groups;
    }]);

    Given that the above code is all I need in order to be able to iterate
    over the groups in my Firebase DB using ng-repeat....


    1. Does doing: $firebase(new Firebase(FBURL + 'groups')).$child("2");
    load all groups before accessing the child or does it only load
    data associated with the child node?
    2. What about: $firebase(new Firebase(FBURL + 'groups/2')); Is that
    the same or different to the line above?

    Finally as a bonus question ;-) .... If I do this:

    $firebase(new Firebase(FBURL + 'groups/1'));
    $firebase(new Firebase(FBURL + 'groups/2'));
    $firebase(new Firebase(FBURL + 'groups/3'));

    How many Firebase connections do I now have open? 1 or 3? Is this an
    inefficient thing to do?

    It's possible I'm not fully understanding how websockets works so my
    apologies if that is the case. I'm used to a more traditional HTTP API
    setup.
    --
    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/43220bb1-1831-461e-ab65-df95d12bc3d1%40googlegroups.com
    <https://groups.google.com/d/msgid/firebase-angular/43220bb1-1831-461e-ab65-df95d12bc3d1%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/CAFHX4%3DopQbzKD04U9yihyW0jEfh7mq2bBs96rA%3Dq%3DKbWbkDJMw%40mail.gmail.com.
    For more options, visit https://groups.google.com/d/optout.
  • David Tuite at Jul 3, 2014 at 12:01 pm
    Great answer Jacob, thanks for that.

    I'll take a look at the upcoming release since I can handle a bit of
    instability for the moment.

    Loving Firebase so far. Keep up the good work.
    On Thursday, 3 July 2014 02:03:41 UTC+1, Jacob Wenger wrote:

    Hey David,

    Great questions! You've entered into some interesting technical territory.
    But I do have answers for you:

    As soon as you do $firebase(firebaseRef), AngularFire loads *ALL OF THE
    DATA* at firebaseRef (whoops!). The same thing happens every time you use
    $child as well. So doing
    $firebase(firebaseRef).$child("users").$child("user10").$child("firstName")
    is *significantly* *less performant* than
    $firebase(firebaseRef.child("users").child("user10").child("firstName")).
    You should always use the latter.

    We realized this is not very clear and caused a lot of trouble for people.
    So - in our upcoming AngularFire 0.8 release - this will be fixed. Using
    $firebase() and $child() will be just as performant as making regular
    Firebase refs. You can access this code now if you'd like
    <https://github.com/firebase/angularFire/tree/release_0.8>, but it may
    still be a bit unstable. The docs for it are here
    <https://github.com/firebase/angularFire/blob/gh-pages/documentation.md>.
    It should be released in a week or two. If you do end up using it, let us
    know if you find any bugs!

    As for your bonus question, make as many Firebase refs as you'd like
    without worrying about performance! They are extremely cheap to make and
    they all use the same websocket to send and receive data.

    Let me know if you've still got questions.
    Jacob
    On Wednesday, July 2, 2014 8:42:00 AM UTC-7, David Tuite wrote:



    I have some questions about how $firebase works.

    Taking this super simple controller for example:

    var app = angular.module("app", ['firebase']);


    app.constant('FBURL', 'https://groupstest.firebaseio.com/');


    app.controller("ApplicationController", [
    '$scope',
    '$firebase',
    'FBURL',
    function($scope, $firebase, FBURL) {
    var groups = $firebase(new Firebase(FBURL + 'groups'));
    $scope.groups = groups;
    }]);

    Given that the above code is all I need in order to be able to iterate
    over the groups in my Firebase DB using ng-repeat....


    1. Does doing: $firebase(new Firebase(FBURL + 'groups')).$child("2");
    load all groups before accessing the child or does it only load data
    associated with the child node?
    2. What about: $firebase(new Firebase(FBURL + 'groups/2')); Is that
    the same or different to the line above?

    Finally as a bonus question ;-) .... If I do this:

    $firebase(new Firebase(FBURL + 'groups/1'));
    $firebase(new Firebase(FBURL + 'groups/2'));
    $firebase(new Firebase(FBURL + 'groups/3'));

    How many Firebase connections do I now have open? 1 or 3? Is this an
    inefficient thing to do?

    It's possible I'm not fully understanding how websockets works so my
    apologies if that is the case. I'm used to a more traditional HTTP API
    setup.
    --
    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/73a451a5-0941-406a-90e8-6504a2ebb2b3%40googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
  • Jacob Wenger at Jul 3, 2014 at 6:00 pm
    Thanks David! Glad I could help. Let me know if you've got other questions
    or running into issues with the 0.8 release code.

    On Thu, Jul 3, 2014 at 1:28 AM, David Tuite wrote:

    Great answer Jacob, thanks for that.

    I'll take a look at the upcoming release since I can handle a bit of
    instability for the moment.

    Loving Firebase so far. Keep up the good work.

    On Thursday, 3 July 2014 02:03:41 UTC+1, Jacob Wenger wrote:

    Hey David,

    Great questions! You've entered into some interesting technical
    territory. But I do have answers for you:

    As soon as you do $firebase(firebaseRef), AngularFire loads *ALL OF THE
    DATA* at firebaseRef (whoops!). The same thing happens every time you
    use $child as well. So doing $firebase(firebaseRef).$child(
    "users").$child("user10").$child("firstName") is *significantly* *less
    performant* than $firebase(firebaseRef.child("
    users").child("user10").child("firstName")). You should always use the
    latter.

    We realized this is not very clear and caused a lot of trouble for
    people. So - in our upcoming AngularFire 0.8 release - this will be fixed.
    Using $firebase() and $child() will be just as performant as making
    regular Firebase refs. You can access this code now if you'd like
    <https://github.com/firebase/angularFire/tree/release_0.8>, but it may
    still be a bit unstable. The docs for it are here
    <https://github.com/firebase/angularFire/blob/gh-pages/documentation.md>.
    It should be released in a week or two. If you do end up using it, let us
    know if you find any bugs!

    As for your bonus question, make as many Firebase refs as you'd like
    without worrying about performance! They are extremely cheap to make and
    they all use the same websocket to send and receive data.

    Let me know if you've still got questions.
    Jacob
    On Wednesday, July 2, 2014 8:42:00 AM UTC-7, David Tuite wrote:



    I have some questions about how $firebase works.

    Taking this super simple controller for example:

    var app = angular.module("app", ['firebase']);


    app.constant('FBURL', 'https://groupstest.firebaseio.com/');


    app.controller("ApplicationController", [
    '$scope',
    '$firebase',
    'FBURL',
    function($scope, $firebase, FBURL) {
    var groups = $firebase(new Firebase(FBURL + 'groups'));
    $scope.groups = groups;
    }]);

    Given that the above code is all I need in order to be able to iterate
    over the groups in my Firebase DB using ng-repeat....


    1. Does doing: $firebase(new Firebase(FBURL + 'groups')).$child("2");
    load all groups before accessing the child or does it only load
    data associated with the child node?
    2. What about: $firebase(new Firebase(FBURL + 'groups/2')); Is that
    the same or different to the line above?

    Finally as a bonus question ;-) .... If I do this:

    $firebase(new Firebase(FBURL + 'groups/1'));
    $firebase(new Firebase(FBURL + 'groups/2'));
    $firebase(new Firebase(FBURL + 'groups/3'));

    How many Firebase connections do I now have open? 1 or 3? Is this an
    inefficient thing to do?

    It's possible I'm not fully understanding how websockets works so my
    apologies if that is the case. I'm used to a more traditional HTTP API
    setup.
    --
    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/73a451a5-0941-406a-90e8-6504a2ebb2b3%40googlegroups.com
    <https://groups.google.com/d/msgid/firebase-angular/73a451a5-0941-406a-90e8-6504a2ebb2b3%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/CAKZX5-5pOJcMKeYuNH4W-0KmTTHzy47Enj42pfsRAaNBLmBdkQ%40mail.gmail.com.
    For more options, visit https://groups.google.com/d/optout.
  • David Tuite at Jul 5, 2014 at 6:44 pm
    Hi Jacob, started working with the 0.8 release today. I have some comments
    and questions.

    Firstly, some things I like:

        - Consistency in terms of when promises are used. Sometimes having to
        use data.$on('loaded', fn) and sometimes having to use data.then(fn) was
        confusing.
        - Less $ sign prefixing <http://stackoverflow.com/a/13497741/574190>.


    Here's 2 questions I have so far.

        - Is any list data downloaded before we call something.loaded()?
        - What happens if I call loaded() multiple times? Does it re-download or
        just return a locally cached copy of the data?







    On Thursday, 3 July 2014 19:00:27 UTC+1, Jacob Wenger wrote:

    Thanks David! Glad I could help. Let me know if you've got other questions
    or running into issues with the 0.8 release code.


    On Thu, Jul 3, 2014 at 1:28 AM, David Tuite <dtu...@gmail.com
    <javascript:>> wrote:
    Great answer Jacob, thanks for that.

    I'll take a look at the upcoming release since I can handle a bit of
    instability for the moment.

    Loving Firebase so far. Keep up the good work.

    On Thursday, 3 July 2014 02:03:41 UTC+1, Jacob Wenger wrote:

    Hey David,

    Great questions! You've entered into some interesting technical
    territory. But I do have answers for you:

    As soon as you do $firebase(firebaseRef), AngularFire loads *ALL OF THE
    DATA* at firebaseRef (whoops!). The same thing happens every time you
    use $child as well. So doing $firebase(firebaseRef).$child(
    "users").$child("user10").$child("firstName") is *significantly* *less
    performant* than $firebase(firebaseRef.child("
    users").child("user10").child("firstName")). You should always use the
    latter.

    We realized this is not very clear and caused a lot of trouble for
    people. So - in our upcoming AngularFire 0.8 release - this will be fixed.
    Using $firebase() and $child() will be just as performant as making
    regular Firebase refs. You can access this code now if you'd like
    <https://github.com/firebase/angularFire/tree/release_0.8>, but it may
    still be a bit unstable. The docs for it are here
    <https://github.com/firebase/angularFire/blob/gh-pages/documentation.md>.
    It should be released in a week or two. If you do end up using it, let us
    know if you find any bugs!

    As for your bonus question, make as many Firebase refs as you'd like
    without worrying about performance! They are extremely cheap to make and
    they all use the same websocket to send and receive data.

    Let me know if you've still got questions.
    Jacob
    On Wednesday, July 2, 2014 8:42:00 AM UTC-7, David Tuite wrote:



    I have some questions about how $firebase works.

    Taking this super simple controller for example:

    var app = angular.module("app", ['firebase']);


    app.constant('FBURL', 'https://groupstest.firebaseio.com/');


    app.controller("ApplicationController", [
    '$scope',
    '$firebase',
    'FBURL',
    function($scope, $firebase, FBURL) {
    var groups = $firebase(new Firebase(FBURL + 'groups'));
    $scope.groups = groups;
    }]);

    Given that the above code is all I need in order to be able to iterate
    over the groups in my Firebase DB using ng-repeat....


    1. Does doing: $firebase(new Firebase(FBURL + 'groups')).$child("2");
    load all groups before accessing the child or does it only load
    data associated with the child node?
    2. What about: $firebase(new Firebase(FBURL + 'groups/2')); Is that
    the same or different to the line above?

    Finally as a bonus question ;-) .... If I do this:

    $firebase(new Firebase(FBURL + 'groups/1'));
    $firebase(new Firebase(FBURL + 'groups/2'));
    $firebase(new Firebase(FBURL + 'groups/3'));

    How many Firebase connections do I now have open? 1 or 3? Is this an
    inefficient thing to do?

    It's possible I'm not fully understanding how websockets works so my
    apologies if that is the case. I'm used to a more traditional HTTP API
    setup.
    --
    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/73a451a5-0941-406a-90e8-6504a2ebb2b3%40googlegroups.com
    <https://groups.google.com/d/msgid/firebase-angular/73a451a5-0941-406a-90e8-6504a2ebb2b3%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/fc19b23d-b575-420d-9165-619fc42a6983%40googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupfirebase-angular @
postedJul 2, '14 at 6:25p
activeJul 8, '14 at 8:22p
posts8
users4

People

Translate

site design / logo © 2021 Grokbase