Skip to content

Commit

Permalink
Updated WebAPI call to include the response type
Browse files Browse the repository at this point in the history
  • Loading branch information
slovely committed Nov 6, 2014
1 parent 4ec67d2 commit 857dfc3
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/TypeScriptSample.Web/App/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ function getPeople() {
$.ajax({
url: "api/person",
method: 'get',
// response could be anything here
}).done((response) => {
}).done((response: Array<TypeScriptSample.Models.Person>) => {
var details = '<ul>';
for (var i = 0; i < response.length; i++) {
details += "<li>" + response[i].Name + "</li>"; //If 'Name' gets changed on the server, this code will fail
Expand Down

0 comments on commit 857dfc3

Please sign in to comment.