Last active
August 23, 2016 01:27
-
-
Save pcote/0af9dbbca38ec1610124ddce985405d9 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 controller = function($http){ | |
| var json_args = { | |
| num1: 5, | |
| num2: 3 | |
| }; | |
| var showResult = function(res){ | |
| alert(res.data.sum); | |
| } | |
| var req = { | |
| url: "/addnums", | |
| method: "post", | |
| headers: { | |
| "Content-type": "application/json" | |
| }, | |
| data: json_args | |
| }; | |
| var promise = $http(req); | |
| promise.then(showResult); | |
| }; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment