本文整理匯總了TypeScript中restful.js.MemberResponse類的典型用法代碼示例。如果您正苦於以下問題:TypeScript js.MemberResponse類的具體用法?TypeScript js.MemberResponse怎麽用?TypeScript js.MemberResponse使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
在下文中一共展示了js.MemberResponse類的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1:
api.one('articles', 1).get().then((response: MemberResponse<Article>) => {
var articleEntity = response.body();
// if the server response was { id: 1, title: 'test', body: 'hello' }
var article = articleEntity.data();
article.title; // returns `test`
article.body; // returns `hello`
// You can also edit it
article.title = 'test2';
// Finally you can easily update it or delete it
articleEntity.save(); // will perform a PUT request
articleEntity.remove(); // will perform a DELETE request
}, (response: any) => {