# Problem handling UserEventsService in AngularJS (loginError case)

**URL:** <https://community.dreamfactory.com/t/problem-handling-usereventsservice-in-angularjs-loginerror-case/1077>\
**Category:** Client SDKs\
**Created:** [May 7, 2015, 4:21pm UTC](https://community.dreamfactory.com/t/problem-handling-usereventsservice-in-angularjs-loginerror-case/1077 "2015-05-07T16:21:24Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![carlok](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.dreamfactory.com/carlok/32/272_2.png) [@carlok](https://community.dreamfactory.com/u/carlok)\
**Post date:** [May 7, 2015, 4:21pm UTC](https://community.dreamfactory.com/t/problem-handling-usereventsservice-in-angularjs-loginerror-case/1077/1 "2015-05-07T16:21:24Z")

</div>

Hi,  
the tutorial [The Authenticated App With AngularJS + DreamFactory User Management Part Two](https://blog.dreamfactory.com/the-authenticated-app-with-angularjs-dreamfactory-user-management-part-two)  
shows how to deal with a successful login using

```
$scope.$on(UserEventsService.login.loginSuccess, function (e, userDataObj) {
  $scope.$parent.currentUser = userDataObj;
  $location.url('/');
});

```

but I didn’t find the right way to manage `UserEventsService.login.loginError`

Do you have a snippet regarding this case? Thanks.

---

<div class="post-metadata">

**Author:** ![jeffreystables](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.dreamfactory.com/jeffreystables/32/173_2.png) [@jeffreystables](https://community.dreamfactory.com/u/jeffreystables)\
**Post date:** [May 7, 2015, 4:40pm UTC](https://community.dreamfactory.com/t/problem-handling-usereventsservice-in-angularjs-loginerror-case/1077/2 "2015-05-07T16:40:41Z")

</div>

Have you reviewed the readme from the user management module?

[https://github.com/dreamfactorysoftware/angular\_dreamfactory\_user\_management\_module/blob/master/README.md](https://github.com/dreamfactorysoftware/angular_dreamfactory_user_management_module/blob/master/README.md)

It covers the namespaced events including `loginError: 'user:login:error'` but I don’t see an example of handling it. Perhaps someone in the community can contribute that.

---

<div class="post-metadata">

**Author:** ![carlok](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.dreamfactory.com/carlok/32/272_2.png) [@carlok](https://community.dreamfactory.com/u/carlok)\
**Post date:** [May 7, 2015, 4:43pm UTC](https://community.dreamfactory.com/t/problem-handling-usereventsservice-in-angularjs-loginerror-case/1077/3 "2015-05-07T16:43:53Z")

</div>

Hi Jeffrey, yes I looked at the user management module. I might try again… meanwhile, thanks.
