このような状況があります: 2 つのタブを持つ Web ページがあります。これらのタブは、angularjs の ng-view を使用する必要があります。これらのタブの特殊性は、C# (ref キーワード) で変数を参照するように、参照で同じ変数を使用する必要があることです。
このデモ のUsing objectセクションをチェックして、私が何を意味するかを知ることができます: http://plnkr.co/edit/zZfUQN?p=preview
<h3>Using object:</h3>
    <div class="example">
      <img class="mainImg" ng-src="{{mainImg.url}}" />
      <p>This is the parent scope with the main image.</p>
      <p>$scope.mainImg.url == {{mainImg.url}}</p>
      <div class="thumbs">
        <p>Thumbs generated with ng-repeat, with ng-click setting <strong>$scope.mainImg.url</strong> (click on them to see what happens):</p>
        <div class="thumbDiv" ng-repeat="img in images">
          <img class="thumb" ng-src="{{img}}" ng-click="mainImg.url = img" />
          <p>This is a child scope generated by ng-repeat.</p>
          <p>$scope.mainImg.url == {{mainImg.url}}</p>
        </div>
      </div>
    </div>
したがって、メイン ページはメイン コンテナーであり、タブは子です。子の間で同じ値を使用するために、それらの子の間の参照として変数を保持する方法。
- 編集
非常に重要なことを忘れています。参照変数は子によって変更される可能性があり、他の子の間で値を保持する必要があります。お手伝いありがとうございます、
カリン