-
Notifications
You must be signed in to change notification settings - Fork 248
Allow Map.values in ng-repeat #397
Comments
See also #394 The best fix for this would be a stable Map.values object. Could you fill a dartbug.com? |
It's not clear to me that this is a problem with dart. Most code wouldn't On Wed, Jan 8, 2014 at 10:50 AM, James deBoer [email protected]:
|
BTW, you run into a similar problem when you do: List get values => [0, 1, 2]; because that creates a new object id on each access. On Wed, Jan 8, 2014 at 10:54 AM, Andrew Chatham [email protected] wrote:
|
This will be fixed with the new change detection. |
My latest thinking on this is that this is a two part fix. PART1: PART2: Together Part1 and Part2: create a clean solution to this problem. |
@mhevery with your part2, how would you access a |
Or in an ancestor scope? |
As part of adding support for |
I believe that PART2 can be accomplished without a change in syntax: have the if (obj is Map) {
_mode = _MODE_MAP_FIELD_;
_instanceMirror = null;
} else if ... would become |
@mhevery, I would be willing to attempt to implement PART2 along the lines of what I outlined above, if you believe that this would be a useful contribution that no one else on the team is working on. |
…and methods Closes dart-archive#359, dart-archive#394, dart-archive#397, dart-archive#757. Relates to dart-archive#772, dart-archive#773.
… to observe lists and maps Closes dart-archive#359, dart-archive#394, dart-archive#397, dart-archive#757. Relates to dart-archive#772, dart-archive#773.
… to observe lists and maps Closes dart-archive#359, dart-archive#394, dart-archive#397, dart-archive#757. Relates to dart-archive#772, dart-archive#773.
Ref: #394 |
fixed in #1269 |
Often the natural way to store data is in a Map, and I'd like to use Map.values in an ng-repeat. ng-repeat has support for Iterable, but HashMap.values creates a new object on each call, so it fails the identical() check used in $watch. This leads to a $digest loop. $watch should be robust to this.
If this isn't possible, it would be nice if $digest loops noticed that they were caused by the underlying collection changing object ids and printed a less confusing error.
The text was updated successfully, but these errors were encountered: