You forgot the quotes around $scope and $location :
var app = angular.module('myApp.controllers', []);
app.controller('Signup', ['$scope', '$location', function($scope, $location) {
$scope.checkEmailValid = function(){
//TODO make a decision about whether to go somewhere, if true do this:
$location.path('/view2');
};
}]);
This should to the trick !