Here I have my index
controller which is in the index component which includes several functions that I call later in another controller:
userParticipate() {
this.ApiPartners.feliwayParticipate().then(res => {
this.$state.go('feliwayMain.success')
}).catch((err) => {
this.errorMessage = err.data.error
console.log('err', this.errorMessage)
})
}
And now here is another controller that is in another component to which I pass the function (thanks to bindings):
validateChoosePet(optin, response) {
if (this.selectedPet) {
if (optin == true) {
this.ParticipateOptin()
} else {
this.Participate()
console.log('erruser', this.errorMessage)
}
}
}
The function ParticipateOptin()
is the same as userParticipate()
it just allows users to have newsletter.
Everything works fine, but I would like to display errors that happen in userParticpate()
at validateChoosePet ()
. I'm getting errors in the console.log
just impossible to display them
I hope I have succeeded in making myself understood, sorry for my English.
{{ ::$root.t.photoshoot.choose_pet_none }}