Discussion:
[AngularJS] directive ng-repeat filter
gkielwasser
2013-02-17 16:23:30 UTC
Permalink
Hi,

I have represented a list of events as follow.
I have 2 directives, "*eventsDir*" directive which is a list of "*eventDir*"
directive. These both directives do NOT have an isolate scope.
The eventsDir is listing events which are present in the root scope in the
"events" variable. "filterevent" filter the events(present in the root
scope) thanks to parameters which are in the root scope.


<eventsDir>
<eventDir></eventDir>
<eventDir></eventDir>
<eventDir></eventDir>
<eventDir></eventDir>
<eventDir></eventDir>
</eventDir>

*eventsDir *content these 2 lines:
1 - {{events | filter : filterevent}}
2 - <eventDir ng-repeat="event in events | filter :
filterevent"></eventDir >

When i'm changing the parameters of the filter, the ng-repeat *is not
refreshed according to the filter*. However, the line 1 print *the right
filtered list*.

Can you explain what I'm misunderstanding?

thanks!
--
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 angular+***@googlegroups.com.
To post to this group, send email to ***@googlegroups.com.
Visit this group at http://groups.google.com/group/angular?hl=en-US.
For more options, visit https://groups.google.com/groups/opt_out.
Pawel Kozlowski
2013-02-17 16:28:38 UTC
Permalink
Hi!
Post by gkielwasser
Can you explain what I'm misunderstanding?
Sure, if you send plunker with your code!
http://plnkr.co/

Cheers,
Pawel
--
Looking for bootstrap-based widget library for AngularJS?
http://angular-ui.github.com/bootstrap/
--
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 angular+***@googlegroups.com.
To post to this group, send email to ***@googlegroups.com.
Visit this group at http://groups.google.com/group/angular?hl=en-US.
For more options, visit https://groups.google.com/groups/opt_out.
gkielwasser
2013-02-17 17:17:11 UTC
Permalink
here is plunker,
http://plnkr.co/edit/5NaUpwdHe3nZ4qbUmvH5?p=preview
--
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 angular+***@googlegroups.com.
To post to this group, send email to ***@googlegroups.com.
Visit this group at http://groups.google.com/group/angular?hl=en-US.
For more options, visit https://groups.google.com/groups/opt_out.
Clint Checketts
2013-02-17 19:06:40 UTC
Permalink
I added the price in, then filter by min price = 1, then change it back to
0 and the templateUrl on behaves correctly, with the exception that the
original list is still appearing.

http://plnkr.co/edit/ghz3GyfCPdqARiHAU1G2?p=preview

This seems familiar...

Unfortunately I need to run to a meeting for a while.
Post by gkielwasser
here is plunker,
http://plnkr.co/edit/5NaUpwdHe3nZ4qbUmvH5?p=preview
--
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
Visit this group at http://groups.google.com/group/angular?hl=en-US.
For more options, visit https://groups.google.com/groups/opt_out.
--
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 angular+***@googlegroups.com.
To post to this group, send email to ***@googlegroups.com.
Visit this group at http://groups.google.com/group/angular?hl=en-US.
For more options, visit https://groups.google.com/groups/opt_out.
Clint Checketts
2013-02-17 23:41:11 UTC
Permalink
OK, I vaguely recall another user running into this on the mailing list and
he had solved it by wrapping the templateUrl in a div the is repeated:

I updated the plunkr and sure enough it works fine:
http://plnkr.co/edit/ghz3GyfCPdqARiHAU1G2?p=preview

This sounds like either a bug in Angular or we're mis-understanding
something about ng-repeat.
Post by Clint Checketts
I added the price in, then filter by min price = 1, then change it back to
0 and the templateUrl on behaves correctly, with the exception that the
original list is still appearing.
http://plnkr.co/edit/ghz3GyfCPdqARiHAU1G2?p=preview
This seems familiar...
Unfortunately I need to run to a meeting for a while.
Post by gkielwasser
here is plunker,
http://plnkr.co/edit/5NaUpwdHe3nZ4qbUmvH5?p=preview
--
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
Visit this group at http://groups.google.com/group/angular?hl=en-US.
For more options, visit https://groups.google.com/groups/opt_out.
--
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 angular+***@googlegroups.com.
To post to this group, send email to ***@googlegroups.com.
Visit this group at http://groups.google.com/group/angular?hl=en-US.
For more options, visit https://groups.google.com/groups/opt_out.
gkielwasser
2013-02-19 12:29:49 UTC
Permalink
thank you very much for this answer!
However, It would be interesting to know why it is not possible to make it
works without wrapping it.
--
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 angular+***@googlegroups.com.
To post to this group, send email to ***@googlegroups.com.
Visit this group at http://groups.google.com/group/angular?hl=en-US.
For more options, visit https://groups.google.com/groups/opt_out.
Loading...