12034 次
4 に答える
5
http://docs.angularjs.org/api/ng.directive:a
href 属性が空の場合にデフォルトのアクションが実行されないように、html A タグのデフォルトの動作を変更します。
于 2013-10-01T09:19:06.923 に答える
0
Try setting href=""
instead of href="#"
. If you are using hashbang mode routing, the latter results in a full-page reload, which is what seems to be happening in your case as well. Any link with href="#"
that you click will cause your app to fully reload the page and load the default route -- in your case Summary
.
于 2013-10-01T04:53:58.167 に答える
0
このコード セグメントを変更します
<li><a href="#
" data-ng-click="setRoute('transactions')"><span
class="icon-reorder"></span>
Transactions</a></li>
に
<li><a href="/transactions"><span
class="icon-reorder"></span>
Transactions</a></li>
于 2013-10-01T04:59:45.327 に答える
0
gotoUrl 関数を取り除き、DOM を次のように変更できます。
<a href="#/transactions"><span></span>Transactions</a>
残りは AngularJS が処理します。
于 2013-10-01T04:56:11.960 に答える