Closed Hecatoncheir closed 8 years ago
This looks like a reflectable
bug, looking into it further...
cc @eernstg
In general, you should avoid using the attributes to set element fields and just set the properties directly. That being said this should work. I tried a simpler version of the gist you posted and that is working for me though, not sure exactly what the difference is.
I try do something:
showCompanyPage(RouteEvent event) async {
Map componentsForPage = new Map();
// Configure components for page
componentsForPage['entity-form'] = 'true';
pageView.components = JSON.encode(componentsForPage);
print('Company page');
}
@PolymerRegister('page-view')
class PageView extends PolymerElement {
PageView.created() : super.created();
@Property(observer: 'componentsChanged')
String components;
@reflectable
componentsChanged(event, [details]) async {
print(components);
}
}
It's sent from router, and it didn't work too. I can't send it another way.
I think maybe you just need to update your version of reflectable, https://github.com/dart-lang/reflectable/search?utf8=%E2%9C%93&q=_checkInstanceParameterListShape shows it being invoked with 3 arguments not 2 like your stack trace shows.
I did it. And it did not help:
When i delete .pub from project directory and run pub serve again i get new trouble for my live:
Uncaught 'package:reflectable/src/reflectable_transformer_based.dart': error: line 256 pos 64: unexpected token '.'
methodName, positionalArguments.length, namedArguments?.keys)) {
What version of the sdk are you running, it seems like maybe you just don't have the null-aware operator support?
1.14.0
dart --version
Dart VM version: 1.14.0 (Thu Jan 28 09:20:03 2016) on "macos_x64"
pub --version
Pub 1.14.0
What version have null-aware operator?
That version should be fine, are you sure that is the same version as the dartium which you are running? (Sometimes people have multiple sdks installed, and if you launch dartium from say an editor you might be running an older version)
Sure, my mistake. Thanks for help. Now work perfectly. Sorry for that.
Its unfortunately pretty easy to get in this situation :(
Yes, it's true :(
I love problems that go away before I even discover them. ;-)
Yeah, it's good :) I need to be more attentively the next time.
Hi. While i open pages, i get a some message error in console:
I just try send json encoded string to polymer element attribute, and print it in event handler function: gist May be i do it wrong?