Skip to content

Instantly share code, notes, and snippets.

@brunodasilvalenga
Created June 16, 2016 18:38
Show Gist options
  • Save brunodasilvalenga/b090c30e6194df4140cf7eb8950a181f to your computer and use it in GitHub Desktop.
Save brunodasilvalenga/b090c30e6194df4140cf7eb8950a181f to your computer and use it in GitHub Desktop.
loadAlunos() {
this.loadingShow();
this.alunoData.getAluno().then((data) => {
this.alunos = [];
if(data.res.rows.length > 0) {
for(var i = 0; i < data.res.rows.length; i++) {
this.alunos.push(
{
id: data.res.rows.item(i).id,
firstName: data.res.rows.item(i).firstName,
lastName: data.res.rows.item(i).lastName,
email: data.res.rows.item(i).email,
img: data.res.rows.item(i).img,
phone: data.res.rows.item(i).phone,
gender: data.res.rows.item(i).gender,
birthday: data.res.rows.item(i).birthday,
address: data.res.rows.item(i).address,
district: data.res.rows.item(i).district,
city: data.res.rows.item(i).city,
state: data.res.rows.item(i).state,
city: data.res.rows.item(i).city,
cep: data.res.rows.item(i).cep,
note: data.res.rows.item(i).note
}
);
}
};
this.numberOfAlunos = this.alunos.length;
this.loadingHide();
}, (error) => {
this.loadingHide();
console.log("ERROR -> " + JSON.stringify(error.err));
});
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment