dart has known error class create public variables can not passed native json template calls. not sure if there has been improved headway on this.
example;
class test{ string a; int b; } would nice translate into:
{"a":"","b":0} it seems when looking around internet , forums dart, issue, , language works closely javascript, terribly large oversight. havent seen yet, though seems might able scrape public variables if using mirrors, seemingly time intensive.
here sample working on.
class usergroup{ string a; int b; usergroup.frommap(map m){ ... } } i receive service call, map cast usergroup.
this produce list binded , passed sub webcomponent access map. this.
<service-call result="{{rowdata}}"></service-call> <grid-creator rows="{{rowdata}}"></grid-creator> and inside of grid creator:
<dom-module id="grid-creator> <template> <div> <template is="dom-repeat" for="{{rows}}" as="row"> <div id="{{row.id}}">{{row.name}}</div> </template> </div> </template> </dom-module> the issue had has grid-creator dynamic, accepting row of maps , parsing accordingly. if list<usergroup> rows doesnt understand row , throw error like:
type 'usergroup' not subtype of type 'map' of 'row'
that means dart classes nativly cannot interact template repeaters @ all, unless class subtype of map. wouldnt make sense me.
that being said, lot of notes september 2015 , prior. curious has progressed.
you say: well, why not have tojson method turns map, parse , intercept class , convert before it hits template.
i mean, guess thing if observer on rowdata , have second variable populated , subsequently refresh grid-creator that isnt point. sort of removes object being passed around , @ point, should remove class component , use maps. if im using maps, why heck use dart? /endrant
anyways, has there been improvements in area?
one of threads reading serialization: https://github.com/dart-lang/sdk/issues/16630
edit: trying concept of having class usergroup extend jsproxy, dont think resolve issue having
Comments
Post a Comment