Link to Plunker: http://plnkr.co/edit/kv082nEAmQIzOdi4cIP6?p=preview


On Sun, Jan 26, 2014 at 1:49 PM, James Brewer <[email protected]> wrote:

> The problem here is that you should be taking advantage of AngularFire to
> make your life easier. In particular, there are two things you are
> interested in:
>
> 1) .$on('change') -- You should bind to this event inside your directive,
> instead of using using `$watch`. AngularFire is a real-time, event-based
> system and so you shouldn't rely on `$digest` being called to trigger an
> update.
>
> 2) .$getIndex() -- This method will give you an array containing the
> objects that are currently stored in Firebase. Since you want to know
> whether there `currentBets` is empty, we can just check that
> `$scope.currentBets.$getIndex().length > 0;'.
>
>
>
> On Sun, Jan 26, 2014 at 11:40 AM, telagraphic <[email protected]>wrote:
>
>> I want to show the "submit winner" button when the currentBets collection
>> has elements in it.
>>
>> I must be missing something basic when looking for children li in the
>> ul#todayBets element.
>>
>> Basically element.children() doesn't find anything?  Is this an issue
>> with ng-repeat?
>>
>> http://plnkr.co/edit/pwH8rFkKBTMOpsY4IisE?p=preview
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "AngularJS" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to [email protected].
>> To post to this group, send email to [email protected].
>> Visit this group at http://groups.google.com/group/angular.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to