Hi Sander,
I found a solution to the problem.
I added this to my directive:
$scope.$on("$destroy",function() {
readSelectedItems();
unreadSelectedItems();
});
This unregisters the rootScope listener from the directive scope.
Can I derive from this behaviour that, although destroy is called on the
directive, it isn't destroyed aslong as it has at least one listener
attached to it?
So I should be very carefull registering and unregistering $rootScope
listeners?
On Tue, Mar 18, 2014 at 9:40 AM, Sander Elias <[email protected]> wrote:
> Hi Johan,
>
> As far as I can see the code you just posted should work as expected. This
> code will give you all boxes unchecked by default.
> I think you left some the crucial part out when you simplified your code.
>
> Regards
> Sander
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "AngularJS" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/angular/h5aiq09TKSQ/unsubscribe.
> To unsubscribe from this group and all its topics, 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/d/optout.
>
--
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/d/optout.