How do I get a PHP array to an angular variable? -


i'm coding website uses php information match database array. however, want display information using angular. how array php angular?

you can have php output information json object on different page.

http://example.com/matchdata.php

<?php      header('content-type: application/json');     echo json_encode($match); ?> 

then use angular fetch data

http://example.com/display.html

<script>     // matchctrl     $http.get('http://example.com/matchdata.php').then(function(response){          $scope.matchdata = response;     }) </script>  <html>     <div ng-controller="matchctrl">         {{matchdata}}     </div> <html> 

Comments

Popular posts from this blog

sublimetext3 - what keyboard shortcut is to comment/uncomment for this script tag in sublime -

java - No use of nillable="0" in SOAP Webservice -

ubuntu - Laravel 5.2 quickstart guide gives Not Found Error -