Thursday, September 3, 2015

Angular http

                     Using angular for http 

  Using angular it is simple to get JSON data and display it in a view.

Edit in plunker


<html ng-app="myApp">
<head><script src=""></script><link rel="stylesheet" href="">
<meta charset="utf-8" />
<body >
      <div ng-controller="customersCtrl">
            <h1>http get using angular</h1>
                <li ng-repeat="x in names">
                    {{'Name:   ' + x.Name + ',     Country:   ' + x.Country }}
    var app = angular.module('myApp', []);
    app.controller('customersCtrl', function($scope, $http) {
            .success(function(response) {
                $scope.names = response.records;


No comments:

Post a Comment