1

How can I refresh the 'detail' state without refreshing its parent (item). in routes:

  $stateProvider.state('item.detail', {
    url: '/:id/detail',
    abstract: true,
    resolve: {
      $modal: ['$modal', function ($modal) {
        return $modal;
      }]
    },
    onEnter: ['$state', '$modal', function ($state, $modal) {
      $modal
        .open({
          templateUrl: 'detail.html',
          backdrop: 'static'
        })
        .result.then(function () {
            $state.transitionTo('item.detail', {id: $state.params.id}, {reload: true});
        })
      ;
    }]

  })

This refreshes the item and detail together.

Adding the state the to reload also doesn't work. Any idea what I'm doing wrong?

Nima
  • 2,100
  • 2
  • 23
  • 32
  • Possible duplicate of [AngularJS UI Router $state reload child state only](http://stackoverflow.com/questions/25316591/angularjs-ui-router-state-reload-child-state-only) – georgeawg Apr 26 '17 at 19:11

1 Answers1

0

Is this what you want to do, I think the interesting part if the reload argument (that you are using):

If reload is a string (or state object), the state object is fetched (by name, or object reference); and \ the transition reloads the resolves and views for that matched state, and all its children states.

Community
  • 1
  • 1
Tonio
  • 4,082
  • 4
  • 35
  • 60
  • None of the solutions worked in my case, at least with my trying. This question is quite similar http://stackoverflow.com/questions/37543098/reloading-only-child-state – Nima Apr 26 '17 at 16:30