New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
QueryList<T>.get(index) #29467
Comments
Why not, but you can do |
But slicing array every time isn't a good solution, I guess.. export class QueryList<T> {
// ...
toArray(): T[] { return this._results.slice(); }
// ...
} |
Sure, if you see it as a performance bottleneck in your application after perf-measuring it... |
@pkozlowski-opensource Even if not a performance bottleneck, it just seems like an oversight that the Angular team provided all of these array-mirroring methods like |
Also like to see this, just awkward boilerplate to pull the array every time |
This commit adds get method to QueryList. PR Close angular#29467
This commit adds get method to QueryList. The method returns an item of the internal results. PR Close angular#29467
This commit adds get method to QueryList. The method returns an item of the internal results by index number. PR Close angular#29467
This commit adds get method to QueryList. The method returns an item of the internal results by index number. PR Close angular#29467
Currently accessing by index like this: queryList.find((_e, i) => i === index); But sure, it would be nice to just do: queryList.get(index); |
This commit adds get method to QueryList. The method returns an item of the internal results by index number. PR Close angular#29467
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
馃殌 feature request
Relevant Package
This feature request is for @angular/core
Description
Now there is no way to get element from
QueryList<T>
by index.Describe the solution you'd like
Add method
get(index)
to QueryListDescribe alternatives you've considered
Very expensive workaround:
The text was updated successfully, but these errors were encountered: