SHARE
TWEET

Untitled

a guest Nov 14th, 2017 53 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. 0
  2.  id "1"
  3.  name   "Company-A21"
  4.  address    "Gany-A11"
  5.    
  6. [{"id":"1","name":"Company-A21","address":"Gany-A11"]
  7.    
  8. <!doctype html>
  9. <html >
  10.     <head>
  11.         <title>Hello AngularJS</title>
  12.         <script src="hello.js"></script>
  13.     </head>
  14.  
  15.     <body>
  16.         <div ng-controller="Hello">
  17.             <p>The ID is {{company.id}}</p>
  18.             <p>The content is {{company.name}}</p>
  19.         </div>
  20.     </body>
  21. </html>
  22.    
  23. angular.module('demo', [])
  24. .controller('Hello', function($scope, $http){
  25.  
  26.     $http.get('http://localhost:4567/api/v1/companies/2').
  27.     then(function(response) {
  28.             $scope.company = response.data;
  29.     });
  30.  });
RAW Paste Data
Top