Hi I have in Firebase a document with a list of users and another with this structure:
In the component "father" I obtain all the users:
<template is="dom-repeat" items="{{usuarios}}" as="usuario">
<admin-consulta-pagos-item usuario="{{usuario}}" yearmes="{{yearmes}}" id="consultaspagos"></admin-consulta-pagos-item>
</template>
then I call the "child" component and what I need to do is to search in a specific year_month if the user apears there, I have a property wich I call: pagado to bind the value to a checkbox, but the console.log works fine but the property doesnt :( I im doing this:
consultar: function () {
that = this;
var usuariocreado = this.fbref('/yearmes/' + this.yearmes + '/' + this.usuario.$key);
usuariocreado.once('value')
.then(function (snapshot) {
var a = snapshot.exists();
console.log('exist in DB: ' + a);
if (a) {
console.log('The user exist: ' + a)
that.pagado = true;
} else {
console.log('The user doesn't exist: ' + a)
that.pagado = false;
}
});
},
And the final result, for example in this case all the checks must be active but only the last one have the correct value :( , how is the best way to solve this? , thanks a lot for your coments: