ng-controller directive assigns controller class to the view. In AngularJS controllers controls the data.

ng-controller is a java script constructor.
<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.2.26/angular.min.js"></script>
</head>

<body>

<div ng-app="" ng-controller="patientController">

First Name: <input type="text" ng-model="firstName"><br>
Last Name: <input type="text" ng-model="lastName"><br>
Gender:<input type="text" ng-model="gender"><br>
Blood Group:<input type="text" ng-model="bg"><br>
<br>
Full Name: {{firstName + " " + lastName}} <br/>
Patient Gender : {{ gender }} <br/>
BG : {{ bg }}
</div>

<script>
function patientController($scope) {
    $scope.firstName="rajeev",
    $scope.lastName="ananth",
    $scope.gender='male',
    $scope.bg='o+ve'
}
</script>

</body>
</html>
Note: patientController is a controller and is a constructor which is assigning initial values in to models. Note: If you write patientController java script function or constructor in html head you need to call the function explicitly.

$scope:

is an application level object using which you can access any model properties or functions defined in your view (html or aspx or jsp or any other view page).

Controllers in external java script files:

In larger projects it is a common practice to store java script code in external java script files, same way we can store controller's code in external java script files. See the following sample which uses controller which is present in external java script file. Write following code In .html page
<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.2.26/angular.min.js"></script>
</head>
<body>
<div ng-app="" ng-controller="patientController">
First Name: <input type="text" ng-model="firstName"><br>
Last Name: <input type="text" ng-model="lastName"><br>
Gender:<input type="text" ng-model="gender"><br>
Blood Group:<input type="text" ng-model="bg"><br>
<br>
Full Name: {{firstName + " " + lastName}} <br/>
Patient Gender : {{ gender }} <br/>
BG : {{ bg }}
</div>
<script src="pc.js">
</script>
</body>
</html>

In .JS file:

function patientController($scope) {
$scope.firstName="rajeev",
$scope.lastName="ananth",
$scope.gender='male',
$scope.bg='o+ve'
}