Thanks Sander, I was keeping that variable private but later thought it 
would be better to make the variable accessible so that the controllers can 
pull the value from there.

On Saturday, April 2, 2016 at 8:44:09 AM UTC+2, Sander Elias wrote:
>
> Hi Harila...,
>
> just use the function you return in the $watch. And is there an reason you 
> are keeping the length in a extra private variable? you could return 
> factroyList.length without an issue..
>
> in your controller:
> $scope.$watch(servicename.returningListLengthFunction, function (newLen,
> oldLen) {
>    //do your stuff here..
> });
>
> Regards
> Sander
>

-- 
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 https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to