有一个改装的矮人。除了使用非常极端的设置
reload:true,我们还可以从本机
ui-router设计中受益:
如果声明的参数已更改,请重新加载状态
因此,这将是新的状态和控制器定义:
.state('projects.edit.surveys', { resolve: { ... // unchanged }, // here we declare param trigger url: "/surveys/{trigger}", views: { '' : { templateUrl: "projects.surveys.html", controller: function($scope, items, $state){ $scope.items = items $scope.addSurvey = function(){ // here we copy current params var params = angular.copy($state.params); // do some tricks to not change URL params.trigger = params.trigger === null ? "" : null; // go to the same state but without reload : true $state.transitionTo($state.current, params, { reload: false, inherit: true, notify: true }) } } } } })从用户的角度来看,一个参数是变化的,但不是它的知名度-这是空或…的String.Empty检查调整和 更多的本地ui-router
解决方案
在这里



