;(function(){ //IIFE for angular
angular.module('brewKeeper')
  .controller('signupController', function($scope, $http, $cookies, $location){
    $scope.users = {
      username: '',
      password: '',
      email: '',
      email: ''
    }
    $scope.submit = function() {
      $http.post('https://brew-keeper-api.herokuapp.com/api/register/', $scope.users)
      .then(function(response) {
        userInfo = "Token " + response.data.token
        $cookies.put("Authorization", userInfo)
        $http.defaults.headers.common = {"Authorization": userInfo}
        $scope.users = { }
        $location.path('/')

      })
    };
  })//CONTROLLER FOR SIGNUP
  .controller('loginCtrl', function($scope, $http, $rootScope, $cookies, $location){//CONTROLLER FOR LOGIN
    $scope.users = {
      username: '',
      password: ''
    }
    $scope.submit= function(){
      $http.post('https://brew-keeper-api.herokuapp.com/api/login/', $scope.users)
      .then(function(response) {
        userInfo = "Token " + response.data.token
        $cookies.put("Authorization", userInfo)
        $http.defaults.headers.common = {"Authorization": userInfo}
        $scope.users = {};
        $('.login').addClass('hidden')
        $('.logout').removeClass('hidden')
        $location.path('/')
      })
      .catch(function(response){
        console.log(response.data)
        if (response.data.username) {
         alert("Please enter a valid username.")
        } else {
         alert("Your password is invalid.  Please try again.")
        }
      })//response if bad login
    }//submit function
    $('.show-signup').on('click', function(){
      $('.register').removeClass('hidden');
      $('.login').addClass('hidden')
    })//show signup form
  })//CONTROLLER FOR LOGIN

.controller('logoutCtrl', function($scope, $http, $cookies){//CONTROLLER FOR LOGOUT
    $http.get('https://brew-keeper-api.herokuapp.com/api/whoami/')
      .success(function(){
        $('.login').addClass('hidden')//DELETE?
        $('.register').addClass('hidden')
        $('.logout').removeClass('hidden')
      })// if logged in
      .error(function(){
        $('.login').removeClass('hidden');//when logged out
        // $('.logout').addClass('hidden');
      })
    $scope.user = {
      email: '',
      password: ''
    }
    $scope.submit= function(){
      var logoutHeader = {"Authorization":$cookies.get("Authorization")}
      $http.post('https://brew-keeper-api.herokuapp.com/api/logout/', logoutHeader)
        .then(function(){
          $('.login').removeClass('hidden');//when logged out
          $('.logout').addClass('hidden');
        })
        $cookies.remove("Authorization")
        $http.defaults.headers.common = {}
    }
  })//CONTROLLER FOR LOGOUT

})();//END IFFE

@@ -608,17 +608,16 @@
 th('/')%0A
-%0A
       %7D)
@@ -613,24 +613,154 @@
 ')%0A      %7D)%0A
+      .catch(function(response)%7B%0A        alert(%22Please fill out all fields carefully.%22);%0A      %7D)//Response if bad signup attempt%0A
     %7D;%0A  %7D)/
@@ -756,24 +756,28 @@
    %7D;%0A  %7D)//
+END 
 CONTROLLER F
@@ -1498,176 +1498,61 @@
     
-if (response.data.username) %7B%0A         alert(%22Please enter a valid username.%22)%0A        %7D else %7B%0A         alert(%22Your password is invalid.  Please try again.%22)%0A        %7D
+ alert(%22Please enter a valid username and password.%22)
 %0A   
@@ -1562,27 +1562,29 @@
 %7D)//response
- if
+s for
  bad login%0A 
@@ -1581,16 +1581,25 @@
 ad login
+ attempts
 %0A    %7D//
@@ -1768,24 +1768,28 @@
  form%0A  %7D)//
+END 
 CONTROLLER F
@@ -2759,16 +2759,20 @@
 %7D%0A  %7D)//
+END 
 CONTROLL

Work out a couple bugs.