angular.module( 'app' )
.controller( 'LoginCtrl', function( $scope, UserSvc ) {
    $scope.login = function( username, password ) {
        UserSvc.login( username, password )
        .then( function( response ) {
            $scope.$emit( 'login', response.data )
        })
    }
} )
angular.module( 'app' )
.controller( 'LoginCtrl', function( $scope, UserSvc, $location ) {
    $scope.login = function( username, password ) {
        UserSvc.login( username, password )
        .then( function( response ) {
            $scope.$emit( 'login', response.data )
            $location.path('/')
        })
    }
} )
Add location change to login
Add location change to login
