xeejem
xeejem

Reputation: 106

ui-router reload single view in multiple views, is it possible?

In a state with multiple named views. Each view has its own controller and resolve. Is it possible to reload an individual view in the state? $state.reload will reload the whole state including all views.

Upvotes: 2

Views: 1509

Answers (2)

Ben George
Ben George

Reputation: 1005

No it is not possible to reload a single view and leave the others as they were.

You can reload just the current state though if that is what you need. Reload the current state, and only the current state (the key being reload param).

$state.transitionTo($state.current, $stateParams, {
 reload: $state.current.name, inherit: false, notify: true
});

Upvotes: 0

İlker Korkut
İlker Korkut

Reputation: 3250

There is a documentation about ui-view.

 <div ui-view="main"></div>

 $stateProvider.state("main", {
    views: {
    "main": {
    template: "main.html"
  }
 }    
});

This code block will load your view;

 $state.go("main", {}, {reload: true});

This can be fired in your view's controller;

Upvotes: 1

Related Questions