[Ionic 4] Issue when i try to show diferent alerts

Hi All,

First of all i’m new with Ionic and trying to implement diferent alerts. One alert will be showed when user fail in the registration procress. Other will be displayed when user try to change the password.

When i click the change password button the alert must be displayed but i’ve got this error:

ERROR TypeError: Cannot set property ‘tipoAlerta’ of undefined
at auth.service.ts:77
at e.b (auth.esm.js:22)
at Kb (auth.esm.js:25)
at Gb (auth.esm.js:25)
at C.push…/node_modules/@firebase/auth/dist/auth.esm.js.k.Wb (auth.esm.js:24)
at pb (auth.esm.js:18)
at ZoneDelegate.push…/node_modules/zone.js/dist/zone.js.ZoneDelegate.invoke (zone.js:391)
at Object.onInvoke (core.js:17299)
at ZoneDelegate.push…/node_modules/zone.js/dist/zone.js.ZoneDelegate.invoke (zone.js:390)
at Zone.push…/node_modules/zone.js/dist/zone.js.Zone.run (zone.js:150)

Can someone tell me what i’m doing wrong?

Thank you very much!


What behavior are you seeing? You haven’t told us what happens when you run the code.

1 Like

Yeah you’re right, sorry. I’ve update the question. The displayed error when i click the change password button is this:

ERROR TypeError: Cannot set property ‘tipoAlerta’ of undefined
at auth.service.ts:77
at e.b (auth.esm.js:22)
at Kb (auth.esm.js:25)
at Gb (auth.esm.js:25)
at C.push…/node_modules/@firebase/auth/dist/auth.esm.js.k.Wb (auth.esm.js:24)
at pb (auth.esm.js:18)
at ZoneDelegate.push…/node_modules/zone.js/dist/zone.js.ZoneDelegate.invoke (zone.js:391)
at Object.onInvoke (core.js:17299)
at ZoneDelegate.push…/node_modules/zone.js/dist/zone.js.ZoneDelegate.invoke (zone.js:390)
at Zone.push…/node_modules/zone.js/dist/zone.js.Zone.run (zone.js:150)

Thank you!

Could it be as simple as changing String to string?

I did it but this not resolved the problem.

The console says that the issue is here:

Captura%20de%20pantalla%20de%202019-07-28%2016-58-44

Only other thing I can think of is that the variable is scoped private instead of public. I would not think that would be an issue since it is being set within the service.

I did it too and nothing…