Update page on event after login


#1

Hi,

how can i update the parent page of a modal on submit?

I’ve got a Cart Controller that should be updated after login.
I tried to fire an event when the login succeds from my AuthService:

Auth.login(credentials).then(function(user)){
   $rootScope.$emit('event:basket-reload', {user:user});
});

And listen to it on the cart controller.

$rootScope.$on('event:basket-reload', function (e) {
	$scope.user = e.user;
	$state.reload();
	$scope.$apply();
});

The Event is fired and the reload is working but the cart scope is not updated. What am i doing wrong?