AngularJS - Updating data from resolve function (routeProvider) -
i have abstract state , other states inherit it.
state.general (abstract) |----------->state.general.list // list collection | |-----------state.general.view // display specific element collection
since several views use same data, thinking in retrieving data in resolve function injectable in both views.
the issue i'm facing when i'm updating collection in state.general.view. if edit element , go state.general.list state, collection not show data have edited.
what way go? though init service in state.general resolve function , inject in controllers. how sound? there other solution more appropriate?
/* code */ .state('state.general', { abstract: true, url: '/', templateurl: './partials/abstract.html', resolve: { collection: function(apiservice){ return apiservice.query(); } } } .state('state.general.list', { url: '/list', templateurl: './partials/list.html', controller: function(collection){ // collection } }) ....
Comments
Post a Comment