In this plunk , you have two ui-router states, parent and child. When a child is called by clicking on the link, since it has the reload: true option, it always reboots. This is normal, but the problem is that the parent state is also reset. Try clicking the Fill 11 link several times and you will see that the parent’s timestamp will also be changed.
How can I reload only a child?
JavaScript:
var app = angular.module("app", ['ui.router']); app.config(function($stateProvider, $urlRouterProvider) { $urlRouterProvider.otherwise("/"); $stateProvider .state('state1', { templateUrl: 'state1.html', controller: function($scope) { $scope.theTime1 = Date.now(); } }) .state('state1.state11', { templateUrl: 'state11.html', controller: function($scope) { $scope.theTime11 = Date.now(); } }); });
angularjs angular-ui-router
ps0604
source share