angularjs - Angular Ui-router: editing a child item with save and cancel where parent has resource resolve -
i have parent child relationship of let's customer , invoices. have customer object navigate state $resource
ui-router resolve $resource
gets data web service. have child array of invoices off customer customerview has links invoices. trying is: if click invoice link nav invoiceedit
state. invoiceedit
state, if cancel return customerview
, invoice not updated, if save return customerview
invoice updated in memory not saved web service until save or cancel pressed on customerview
. also, on customerview
can press add add invoice. thought push new invoice customer.invoices collection , nav invoiceedit
state.
so issue is, if invoiceedit
, upon save or cancel if nav customerview
ui-router, $resource
reload web service.
it kind of want state.resolve when loading controller/state not when returning it.
does know of design pattern deal this?
Comments
Post a Comment