Skip to main content
replaced http://stackoverflow.com/ with https://stackoverflow.com/
Source Link
URL Rewriter Bot
URL Rewriter Bot

I have a state and a nested state in my app.js file. The parent state has a button that controls what is viewed in the nested state, this is done by setting url parameter and the nested state's controller figures out what to show. I want to reload JUST the nested state when the user clicks the button.

I have both the parent state and the state I want to be reloading now on click.

I found this stackoverflowstackoverflow but the button being click is on the same page as the view being reloaded.

App.js file

.state('index.main', { url: 'main/:userID', templateUrl: 'views/main.html', controller: 'MainCtrl' }) .state('index.main.user', { url: '/', views: { 'user@index' : { templateUrl: 'views/user.html', controller: 'UserCtrl' } } }) 

Parent Controller

$scope.showUser = function(user) { $state.go('index.main.user', { userID: user._id }); } 

I have a state and a nested state in my app.js file. The parent state has a button that controls what is viewed in the nested state, this is done by setting url parameter and the nested state's controller figures out what to show. I want to reload JUST the nested state when the user clicks the button.

I have both the parent state and the state I want to be reloading now on click.

I found this stackoverflow but the button being click is on the same page as the view being reloaded.

App.js file

.state('index.main', { url: 'main/:userID', templateUrl: 'views/main.html', controller: 'MainCtrl' }) .state('index.main.user', { url: '/', views: { 'user@index' : { templateUrl: 'views/user.html', controller: 'UserCtrl' } } }) 

Parent Controller

$scope.showUser = function(user) { $state.go('index.main.user', { userID: user._id }); } 

I have a state and a nested state in my app.js file. The parent state has a button that controls what is viewed in the nested state, this is done by setting url parameter and the nested state's controller figures out what to show. I want to reload JUST the nested state when the user clicks the button.

I have both the parent state and the state I want to be reloading now on click.

I found this stackoverflow but the button being click is on the same page as the view being reloaded.

App.js file

.state('index.main', { url: 'main/:userID', templateUrl: 'views/main.html', controller: 'MainCtrl' }) .state('index.main.user', { url: '/', views: { 'user@index' : { templateUrl: 'views/user.html', controller: 'UserCtrl' } } }) 

Parent Controller

$scope.showUser = function(user) { $state.go('index.main.user', { userID: user._id }); } 
Source Link
tester123
  • 1.1k
  • 2
  • 12
  • 18

Reload nested state only not parent with url parameter ui-router

I have a state and a nested state in my app.js file. The parent state has a button that controls what is viewed in the nested state, this is done by setting url parameter and the nested state's controller figures out what to show. I want to reload JUST the nested state when the user clicks the button.

I have both the parent state and the state I want to be reloading now on click.

I found this stackoverflow but the button being click is on the same page as the view being reloaded.

App.js file

.state('index.main', { url: 'main/:userID', templateUrl: 'views/main.html', controller: 'MainCtrl' }) .state('index.main.user', { url: '/', views: { 'user@index' : { templateUrl: 'views/user.html', controller: 'UserCtrl' } } }) 

Parent Controller

$scope.showUser = function(user) { $state.go('index.main.user', { userID: user._id }); }