Some simple example for AngularJS code given below,
In HTML add the module name and source file,
<html lang="en" data-ng-app="App_Name">
<src="../your_path/angular.min.js"> //Javascript file
In Script load the module and use $http
function call the servlet,
angular.module('App_Name', [])
.controller('App_Controller', ['$scope','$http', function($scope, $http) {
$http.post('http://localhost:8080/URL.do').
success(function(data, status, headers, config) {
//console.log(data);
$scope.myVar = data; //Assign to AngularJS Variable
}).
error(function(data, status, headers, config) {
//console.log(data);
});
}]);
Inside body,
<body data-ng-controller="App_Controller">..</body>
Hope this helps.