Computed properties in Backbone

后端 未结 4 1175
暖寄归人
暖寄归人 2020-12-03 05:25

I have a scenario where the data being manipulated on the client is presented and interacted with in a different way than it is represented on the server.

Consider t

4条回答
  •  北海茫月
    2020-12-03 06:11

    Your model should correspond as closely as possible to what you have server side. So stick with start_at and end_at. That will greatly simplify your sync() operations.

    On your edit form's View, you can:

    1. Compute start_date, start_time, duration through simple functions and call them in the template.
    2. Convert to start_at and end_at on submitting.

提交回复
热议问题