Save changes to RESTful URLS with Breeze JS

痞子三分冷 提交于 2019-12-12 12:13:48

问题


I'm just getting started with Breeze. I'm not using .Net. I've used the edmunds example to GET data, but now I'm trying to POST data.

I've tried using manager.saveChanges() which posts a collection of changes to a "SaveChanges" URL. While this is awesome, I'd prefer to have the option of sending the changes individually to RESTful URLS (ie, updating a todo would POST to todo/:id).

Is there any way to configure Breeze to do this?

Failing that, is the "SaveChanges" URL customizable?


回答1:


We are working on exactly that, but it isn't available yet. Soon...

What you can do right now, is change the server endpoint for 'SaveChanges' via the SaveOptions.resourceName property. (See the EntityManager.SaveChanges api for more info). You can also intercept the SaveChanges call on the server. ( See Save interception in the Breeze Documentation).



来源:https://stackoverflow.com/questions/16796102/save-changes-to-restful-urls-with-breeze-js

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!