Created
October 29, 2021 16:28
-
-
Save anytizer/b2c55d443105e7152bf9927b74fa2e0e to your computer and use it in GitHub Desktop.
AngularJS Invoice JSON ($http example)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html> | |
<head> | |
<title>Invoice</title> | |
<script src="angular.min.js"></script> | |
<meta name="viewport" content="width=device-width, initial-scale=1" /> | |
<link rel="stylesheet" href="w3.css" /> | |
</head> | |
<body ng-app="ReportsApp" ng-controller="InvoiceController"> | |
<div> | |
{{invoice}} | |
</div> | |
</body> | |
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var app = angular.module("ReportsApp", []); | |
app.controller("InvoiceController", ["$scope", "$http", | |
function ($scope, $http) { | |
$http({ | |
method : "POST", | |
url: "invoice.php", | |
}) | |
.then(function (response) { | |
$scope.invoice = response.data; | |
}, function (response) { | |
$scope.invoice = "Request failed"; | |
}); | |
}]); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment