Web
Analytics
$http Service get method in Angularjs and asp.net mvc | Angular | ASP.NET Tutorials

For Consultation : +91 9887575540

Stay Connected :

$http Service get method in Angularjs and asp.net mvc

What is $http service

$http is an AngularJS service for reading data from remote servers.

This service make communication with the remote HTTP servers via the browser’s  XMLHttpRequest object or via JSONP.

Methods of $http services

  • get(url, [config]);
  • head(url, [config]);
  • post(url, data, [config]);
  • put(url, data, [config]);
  • delete(url, [config]);

Get Method of $http service

Syntax of get method

 

 

$http.get('/someUrl', config).

  success(function (data, status, headers, config) {

//Write code to Show Response data

  }).

  error(function (data, status, headers, config) {

      //Write code for handling error

  });

Demo
In this demo , I will create an database table employee and fetch data from it using $http service’s

Download Source Code