Angular 1 and Angular 2 Integration

How to call Restful APIs/Services in AngularJs?

In the AngularJs, we can use following methods to achieve this.
1.      $http Service
2.      $resource Service
3.      Rest Angular

The example as,

<!DOCTYPE html>

  <script src=""></script>
  <script src=""></script>
    var appController = function($scope, $http) {
        .success(function(response) {
          $scope.Info = response;
        .error(function(response) {
          $scope.message = "Error!!";

  <div ng-app ng-controller="appController">
    <h3>How to call Restful APIs/Services in AngularJs?

      IP - {{Info.ip}}
      <br/> About - {{Info.about}}
    <a href='' target='_blank'>For more..</a>


The output as,


Hey! I'm Anil Singh. I author this blog. I'm Active Blogger, Programmer. I love learning new technologies, programming, blogging and participating the forum discussions more...
My Blogs - and
My Books - Interview Questions and Answers Books- Get Your Book in 15+ Digital Stores Worldwide..

You Might Also Like Powered by Blogger.
ASK Questions