javascript - Ember data create record and add incrementProperty/decrementProperty on additional clicks -
i trying create cart type order page in emberjs.
this looks http://emberjs.jsbin.com/qanujodo/3#/tickets
when clicked on add 1 ticket model saves ticketquantity, , when added 1 more adds model duplicating model records.
what want is, when ticketquantity changes update data store record , if same tickettype record present remove records , save current record based on ticketquantity .
currently when add 1 adds record data store, , if added more record stored previous records not deleted. should true tickettypes.
ideally should pointed out rwjblue in #emberjs irc, ticketcontroller should keep track of order creates , create once, incrementproperty/decrementproperty needed on subsequent cliks on add one/decrease 1 button. how go ?
check out: http://jsbin.com/giticexa/3#/tickets
didn't touch ui, can see model either created if not present or increment existing model if 1 matches.
best of luck!
Comments
Post a Comment