Speed up development with full-stack environments for every branch.

Learn More

AngularJS NodeJs get request -vishwas [express, Node.js and Angular.js]

Forked from AngularJS NodeJs Basic Example for post request -vishwas.

5 Runs 6 Views 0 Copies
Saved

Saved

vishwas 2

vishwas
published 6 days ago

    angular.module('myApp').controller('AppCtrl', function($scope,$http) {
      $scope.message = 'Hello World from client'; 
      
       $scope.click = function(message)
     {
       
        $http.get('/getty/5')
        .then(function(response) {
            //First function handles success
           
             $scope.message = 'sucess from server'+response.data.message
        }, function(response) {
            //Second function handles error
            
             $scope.message = 'Failure from server ! Bro please check it out'
        });
     }
      
    });
    Please login/signup to get access to the terminal.

    Your session has timed out.

    Dismiss (the page may not function properly).