0

When there is an error,it will give .then()..then() is not a function

ngServices.$http
    .post(settings.webservices.login, {
        CampaignName: settings.app.campaignName,
        Email: this.model.email,
        Password: this.model.password,
        ItemId: settings.app.itemId
    })
    .then(this.__onLoginSuccess__.bind(this))
    .then(this.__onGISpecificSuccess__.bind(this))
    ['error'](this.__onLoginError__.bind(this));
M4ver1k
  • 1,505
  • 1
  • 15
  • 26
benone
  • 576
  • 1
  • 5
  • 21
  • You can look into this http://stackoverflow.com/questions/16385278/angular-httppromise-difference-between-success-error-methods-and-thens-a?rq=1 – Shidil Eringa Jan 11 '16 at 06:22
  • 1
    try 'catch' instead of 'error' – Shidil Eringa Jan 11 '16 at 06:22
  • @ShidilDinesh, `.then()` is not a function comes up when the parent object doesn't contain the static definition of the function; or doesn't contain its equivalent signature. @benone, I'd suggest you to have a look at if you have the dependencies (`$http`) loaded correctly. Also, I presume that `then` chaining isn't the preferred way of doing this. There is an `err` call back in then as well, in case you want to display the error. – weirdpanda Jan 11 '16 at 08:09

0 Answers0