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

Popular posts from this blog

php - render data via PDO::FETCH_FUNC vs loop -

c++ - OpenCV Error: Assertion failed <scn == 3 ::scn == 4> in unknown function, -

The canvas has been tainted by cross-origin data in chrome only -