I'm stuck in a strange situation where my data is getting lost while setting it to a object. Will try to elaborate the situation. this.tempRenewals = this.findById(this.renewals,'id',21869);
findById(arr,searchBy,val){
if(!val){
return {};
}
if(arr){
return arr.find(x => x[searchBy] == val);
}
}
value of renewals object
[{"id":21869,"benefitEndDate":"02/22/2019","premium":0,"enrollmentStatus":"INFORCE","policyId":"test21331","productType":null,"stEnrollmentId":null}]
After findById is evaluated, I get date values undefined. I get below value in tempRenewals.
"{"id":21869,"premium":0,"enrollmentStatus":"INFORCE","policyId":"test21331","productType":null,"stEnrollmentId":null}"
After debugging got to know, its losing value after the below code is evaluated.
this._setProperty(property, value);
in property-accessors.html(polymer\lib\mixins\property-accessors.html), its getting called internally.
I'm using 2-way binding with vaadin-date-picker, which is actually causing issue.
<vaadin-date-picker value="{{tempRenewals.benefitStartDate}}"></vaadin-date-picker>
But I'm unable to identify how do I resolve it.