Skip to content

Commit 857dfc3

Browse files
committed
Updated WebAPI call to include the response type
1 parent 4ec67d2 commit 857dfc3

File tree

1 file changed

+1
-2
lines changed
  • src/TypeScriptSample.Web/App

1 file changed

+1
-2
lines changed

src/TypeScriptSample.Web/App/app.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@ function getPeople() {
88
$.ajax({
99
url: "api/person",
1010
method: 'get',
11-
// response could be anything here
12-
}).done((response) => {
11+
}).done((response: Array<TypeScriptSample.Models.Person>) => {
1312
var details = '<ul>';
1413
for (var i = 0; i < response.length; i++) {
1514
details += "<li>" + response[i].Name + "</li>"; //If 'Name' gets changed on the server, this code will fail

0 commit comments

Comments
 (0)