Skip to content
This repository was archived by the owner on Feb 22, 2018. It is now read-only.

Map piped into filter as _MapChangeRecord rather than Map #715

Closed
chalin opened this issue Mar 12, 2014 · 7 comments
Closed

Map piped into filter as _MapChangeRecord rather than Map #715

chalin opened this issue Mar 12, 2014 · 7 comments

Comments

@chalin
Copy link
Contributor

chalin commented Mar 12, 2014

Running the following HTML snippet

  <p>{{ {"a":1} | json }}</p>

fails stating that the object is not encodable. If you print the type of the argument received by the json filter (see below), then it shows

jsonObj is _MapChangeRecord

rather than showing jsonObj as a Map. The same snippet works under angular 0.9.8.


@NgFilter(name:'json')
class JsonFilter {
  call(jsonObj) {
    print("jsonObj is ${jsonObj.runtimeType}");
    return JSON.encode(jsonObj);
  }
}
@vicb
Copy link
Contributor

vicb commented Mar 13, 2014

I do have a fix. I am adding some tests and will merge it.

@vicb vicb closed this as completed in b32beec Mar 13, 2014
@chalin
Copy link
Contributor Author

chalin commented Mar 13, 2014

@vicb, thanks for the quick fix (nice to have someone in an earlier time zone ;). I would have attempted to find the bug myself but I can't run tests locally anymore. My current guess is that it might have to do with the latest version of Dartium.

@vicb
Copy link
Contributor

vicb commented Mar 13, 2014

@chalin I have the same error from times to times, you should keep trying. You can also enable travis on your repo and let him run the tests as a temporary workaround.

@chalin
Copy link
Contributor Author

chalin commented Mar 13, 2014

I guess you have not nailed down the source of the problem? Thanks for the suggested workaround (though the edit-test cycle becomes much longer then).

@michalpie
Copy link

When the patch is going to be published in pub? Now simple filters like:
<li ng-repeat="e in s.entries | filter:{visible:true}">
are not working and we are stuck.

@vicb
Copy link
Contributor

vicb commented Mar 17, 2014

The next release should occur on Thursday - meanwhile you can point to the git master branch in your pubspec.yaml

@michalpie
Copy link

Thanks a lot!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

3 participants