Javascript 为什么在$state.go(';dashboard';…)上没有点击此处的仪表板状态;。。。?

Javascript 为什么在$state.go(';dashboard';…)上没有点击此处的仪表板状态;。。。?,javascript,angularjs,angular-ui-router,Javascript,Angularjs,Angular Ui Router,预期 登录后,应用程序重定向到$state容器,其中包含仪表板和提要。然后选择一个ticker应使用ticker对象更新仪表板状态。因此,tags.component应使用ticker$state对象重新初始化 结果 登录后,应用程序重定向到$state容器,其中包含仪表板和提要。选择股票代码不会更改$state $scope.clickTicker = function(ticker) { console.log('ticker', ticker) $state.go('das

预期 登录后,应用程序重定向到$state
容器
,其中包含
仪表板
提要
。然后选择一个ticker应使用ticker对象更新
仪表板
状态。因此,tags.component应使用ticker$state对象重新初始化

结果 登录后,应用程序重定向到$state
容器
,其中包含
仪表板
提要
。选择股票代码不会更改$state

$scope.clickTicker = function(ticker) {
    console.log('ticker', ticker)
    $state.go('dashboard', { ticker: ticker }); // <--
}
$scope.clickTicker=功能(ticker){
console.log('ticker',ticker)
$state.go('dashboard',{ticker:ticker});//Use

这应该会有所帮助

<div class="container">
  <div class="row">
    <div class="col-sm-8">
      <section>
        <dashboard-module></dashboard-module> // <-- dashboard component & state
      </section>
    </div>

    <div class="col-sm-4">
      <section>
        <feed-module></feed-module>
      </section>
    </div>
  </div>
</div>
var routerApp = angular.module('routerApp', ['ui.router', 'container', 'feed', 'tickers', 'tags', 'social', 'view']);

routerApp.config(function($stateProvider, $urlRouterProvider) {

  $urlRouterProvider.otherwise('/login');

  const login = {
    name: 'login',
    url: '/login',
    templateUrl: 'login.html',
    bindToController: true,
    controllerAs: 'l',
    controller: function($state) {
      this.login = function() {
        $state.go('container', { });
      }
    }
  }

  const dashboard = {
    parent: 'container',
    name: 'dashboard',
    url: '/dashboard',
    params: {
      ticker: {},
      tag: {}
    },
    template: '<dash-module></dash-module>',
    controller: function($scope, $state) {
      console.log('Dashboard template state', $state.params);
    },
    views: {
      '' : {
        templateUrl: 'dashboard.html',
      },
      controller: function($scope, $state) {
        console.log('Dashboard view state', $state.params);
      }
    }
  }

  $stateProvider
    .state(login)
    .state(dashboard);
})
container.component('dashboardModule', {
  templateUrl: 'dashboard.html',
  constrollerAs: 'dash',
  bindings: {
    ticker: '<',
  },
  controller: function($scope, $state, $stateParams) {
    console.log('Dashboard component state.params', $state.params);
    console.log('Dashboard component stateParams', $stateParams)
  }
})
<div class="container">
  <div class="row">
    <div class="col-sm-8">
      <section>
        <div class="jumbotron text-center salmon">
           <h3>The Dashboard Stuff</h3>
        </div>

        <div class="container">
          <div class="row">
            <div class="col-sm-8 pad0">
              <view-module></view-module>
            </div>
          </div>
        </div>

        <div class="container">
          <div class="row">
            <div class="col-sm-2">
              <tickers-module ticker="dash.ticker"></tickers-module>
            </div>
            <div class="col-sm-2 ml10">
              <tags-module></tags-module>
            </div>
            <div class="col-sm-2">
              <social-module></social-module>
            </div>
          </div>
        </div>
      </section>
    </div>
  </div>
</div>
$state.go('dashboard', { ticker: ticker }, {reload: true});