Posts

Image
POSTING DATA INTO DATABASE USING SERVLET  AND $HTTP METHOD IN ANGULAR JS We all know that we cannot directly connect to the database through Angular JS as per the AngularJS code definition. So in order to solve that issue we have a $http method in Angular JS which solves the above problem of dealing with the database through Angular JS. Lets go through the syntax of the $http method in Angular JS. The $http method is a function which accepts a single argument which can be called a configuration object and this object is used to generate a http request and it returns a promise as an output. Syntax of $http method: $http({ method:’’, url:’’, params:{ ‘ key1’:value1, ‘ key2’:value2, ‘ key3’:value3, . . . . } }) .then(function(response){ alert(response.status); alert(success); }.function(response){ alert(response.status); alert(response.statusText); alert(un success); }); }): Now let us get to know the