1

I needed a solution that will recognize if $last event occurred after an ng-repeat dynamic filtering \ adding of items because angular doesn't recognize changes to the iterated object- unless the object gets more properties. I tried to use this solution, but I also needed to pass local scope to the filter module I created, something like this :

<div ng-repeat="item in (list.content | ngrepeatEndEventFilter: this)" >, and it was in that moment that the app entered a $disgest loop. I know i shouldn't access or especially edit the scope through filter modules, but I couldn't get the filter module to emit events without doing so (as suggested before at the above link.) - I'm getting an error stating that me.$emit is not a function.

My questions are:

1. Is there a more elegant and whole solution to the ng-repeat $last event detection issue than the one suggested here?

2. How come that calling var me = this; me.$emit('eventName') from inside a filter module returns an error?

Thanks.

Community
  • 1
  • 1
DotBot
  • 2,380
  • 2
  • 23
  • 32

0 Answers0