2

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.

3
  • No, there is not. What is your use case? Commented Nov 26, 2014 at 19:41
  • Let's say I have a dropdown list that also serves as a way to pick each user you want to edit. It has a controller and shows the names of the users. Say someone edits their name and save to the repo, I want to information to be reflected in the dropdown list. In that case, i want to refresh the view containing the dropdown list to pull from the server whenever there is an update to the name. Commented Nov 26, 2014 at 22:24
  • so you must use your controller fn to go retrieve the values, put them on the $scope, and let the dropdown read from $scope? Commented Nov 26, 2014 at 23:00

2 Answers 2

1

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;

Sign up to request clarification or add additional context in comments.

1 Comment

This will reload the 'main' state. It just so happens you have view + state name the same 'main'.
0

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
});

1 Comment

Single word answer would be appropiate :) ... "NO".

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.