Comments (10)
That's entirely not the fault of vs-repeat
. The problem is that vs-repeat
creates new non-isolated scope. And if you write:
<div ng-repeat="item in filtered = (items | filter:MyFilter | filter:query )">
you basically write to a filtered
variable on the current scope. If you wrap it with vs-repeat
the filtered
variable gets written into vs-repeat
's scope not the outer scope. Writing like that:
<div ng-repeat="item in filtered.result = (items | filter:MyFilter | filter:query )">
should fix the issue. Chceck out the updated gist: https://gist.github.com/kamilkp/40332795f8cf256772ce/revisions
I didn't test it but i'm pretty sure it will work like that.
from angular-vs-repeat.
Yes, filters are not supported yet. Also this syntax:
<div ng-repeat="{key, value} in someObject">
is not supported yet.
Supporting filters is relatively easy to implement so i'll try to do it by the end of the week.
from angular-vs-repeat.
That would be great!
from angular-vs-repeat.
Try it now (pull latest commit from master). Filters should be working now.
from angular-vs-repeat.
Kamilkp it works like a charm, just tested it with multiple filters. 😉 Thanks for the help!
from angular-vs-repeat.
Your directive is best solution (imo) for data with 200+ items, instead of pagenation or (fullpage) inifinity scroll.
from angular-vs-repeat.
I noticed that this type of filtering syntax is not working:
<div ng-repeat="item in filtered = (items | filter:MyFilter | filter:query )">
This is useful to get the total length of the filtered items.
from angular-vs-repeat.
Well, that's odd since my regex produces the exact same output as the regex in the original ngRepeat directive. Can you make a jsfiddle with an example?
from angular-vs-repeat.
I had problems with jsFiddle so i made a gist with single html file example. Both with a normal ng-repeat and vs-repeat. You can check it here: https://gist.github.com/tcdevs/b53858b2df776ce9f3ff
When you run the example you see that the applied filters and filtered1 model work correctly but the filtered2 model not.
from angular-vs-repeat.
I did test it and you are once again correct. Nice trick to use the ng-init attribute! That's one of the ng-attributes i never actually use, but in this case its handy.
Thanks again for the quick help!
from angular-vs-repeat.
Related Issues (20)
- Demo page still uses version 1.1.7
- newer 2.0.X versions wont run with javascript HOT 1
- items stuck between adding/removing cause scroll flicker HOT 2
- is it possible to have multiple block of vs-repeat all specifying the same parent? HOT 1
- scroll horizontal doesn't show all elements
- Unable import the angular-vs-import
- Bug Ionic 1. Version 2+ does not work with Ionic 1 HOT 1
- [Question] - How to use variable size in the most recent version HOT 4
- [Question] - how to tell which items are visible HOT 1
- Content is offset from screen on mobile after scrolling a long list HOT 1
- two ng-repeat in vs-repeat
- one issue related to the fullcalendar use
- vs-repeat on object HOT 1
- Displaying a heading with nested repeats
- how ti use with angularJs datatable?
- bower release for 2.0.13
- angular 1.5?
- Inability to use $index
- Everything rendered or only firsts HOT 1
- The horizontal state does not work at runtime
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from angular-vs-repeat.