I try like this:
$http({ method: \'POST\', url: \'/token\', data: { username: $scope.username, password: $scope.password, grant_type: \'password\' } }).success(f
Do this:
$http({ url: '/token', method: 'POST', data: "userName=" + $scope.username + "&password=" + $scope.password + "&grant_type=password" })