Skip to content
Advertisement

TypeError: Cannot read property ‘then’ of undefined

JavaScript

Above function return a string like “failed”. However, when I try to run then function on it, it will return error of

JavaScript

and the cursor is indicate right after connected and before .then.

Below is the full function:

JavaScript

UPDATE

Here is the islogged() function

JavaScript

I am certain that the $checkSessionServer will result in a “failed” string. Nothing more.

Advertisement

Answer

You need to return your promise to the calling function.

JavaScript
Advertisement