Luegg / angularjs-scroll-glue

An AngularJs directive that automatically scrolls to the bottom of an element on changes in it's scope.
439 stars 78 forks source link

Why watch function calling multiple times??? #25

Closed abdheshkumar closed 1 year ago

abdheshkumar commented 9 years ago

Hi, I just use your angular directive code for scroll bottom in chat box but i realized watch function calling number of times. According to angular documentation it should be call only two times. so could you tell me why it is calling multiple times?

Luegg commented 9 years ago

scope.$watch should only be called once per scroll-glue tag used in your markup. Can you elaborate with an example?

abdheshkumar commented 9 years ago

@Luegg Thanks for quick reply. No, scope.$watch calling two times when i used it in separate directive(in parent directive). When i used in child directive it's calling multiple times and even calling continuously but parent directive already implemented scope.$watch for some object changes. so it may be happening because of parent directive scope.$watch implementation ?