Skip to content
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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Subscribe to specific range of array, like A20:A100 in Excel #4194

Open
IvanRave opened this issue Dec 3, 2016 · 4 comments
Open

Subscribe to specific range of array, like A20:A100 in Excel #4194

IvanRave opened this issue Dec 3, 2016 · 4 comments

Comments

@IvanRave
Copy link

IvanRave commented Dec 3, 2016

Wildcard paths (like foo.*) represent all changes to a given path and its subproperties, including array mutations.

Is there any possibility to subscribe to specific range of array, like subscription in Excel, for example:

computed('cells.20:100.value', sum(values))
@arthurevans
Copy link

It is not. On the other hand, you can write an observer or computing function that simply ignores changes outside that range.

For a computed binding (which accepts literal arguments) you could even add from, to arguments, so you could do something like:

<some-el some-prop="[[_computeSum(myArray, 20, 100)]]">

@IvanRave
Copy link
Author

IvanRave commented Dec 7, 2016

Angular uses watch expressions (functions) for difficult cases:
$watch(watchExpression, listener, [objectEquality]);

It allows to subscribe to any piece of data, but

The watchExpression is called on every call to $digest() and should return the value that will be watched

@stale
Copy link

stale bot commented Mar 13, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Mar 13, 2020
@stale
Copy link

stale bot commented Mar 19, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants