问题
I am trying to pass data to custom component. The example at http://www.dartlang.org/articles/web-ui/#pass-data-to-component works good.
But I'm trying to pass a JsonObject var, and it crash with this message:
Exception: type 'String' is not a subtype of type 'JsonObject' of 'value'.
So it seems like I can pass only strings and numbers data?
回答1:
This works for me when passing the Map class. Perhaps you could change your code to use the dart:json library and the core library Map class, rather than the third-party JsonObject.
JsonObject also uses the mirrors library, which is not yet supported in dart2js, so may not be a good fit for browser based development.
来源:https://stackoverflow.com/questions/15589757/dart-web-ui-passing-object-data-to-a-component