1

I have a list of tags built from a JSON object...

<div ng-repeat="comedian in comedians.details | orderBy: 'tag' | unique: 'tag'">
    <span ng-click="search = { tag: comedian.tag }">{{ comedian.tag }}</span>
</div>

And a list of images built from the same object...

<div ng-repeat="comedian in comedians.details | orderBy: 'name' | filter:search:strict">
    <img width="50" src="{{ comedian.image }}" alt="{{ comedian.name }}">
</div>

Both lists build as expected. But the click event is not firing to filter the images. If I manually build the list of tags like below the click event works...

<span ng-click="search = { tag: 'Character'}">Character</span>
<span ng-click="search = { tag: 'Sitcom'}">Sitcom</span>

But inside the ng-repeat they do not. Let me know if you need any other details! Thanks

1 Answers1

0

Like @Cherniv suggested in the first comment: use $parent.search so assing to the parent scope.

I'm mostly adding this as an answer so it can be accepted, since this question looks pretty unanswered at first sight, while it's actually solved.

WhyNotHugo
  • 9,423
  • 6
  • 62
  • 70