mardi 19 juillet 2016

VueJS: Uncaught (in promise) TypeError: Cannot read property 'push' of undefined

I am getting the 'cannot read property push of undefined' error: here is my vueJs code:

data:{
CoIsignedListUID:[]
}
methods:{

fetchCoISigned: function () {
            this.$http.get('/cimsm/public/api/fetchCoIsigned/' + this.conflictofInterest.complaintID).then(function (response) {
                var data = response.data;
                this.$set('CoIsignedList', data);
                data.forEach(function (detail) {
                    this.CoIsignedListUID.push(detail.uID);
                });
            });

what am i doing wrong? Thanks



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire