Angular Bootstrap UI を使用して、静的コンテンツを含むタブセットを表示しています。含めたブートストラップ スクリプトは ui-bootstrap-tpls-0.6.0.min.js です。
ここに私のマークアップがあります:
<tabset>
<tab ng-show="$parent.hideme" ng-class="{active:$parent.hideme}">
<tab-heading>
tab1
</tab-heading>
<div>
tab content 1
</div>
</tab>
<tab ng-hide="$parent.hideme" ng-class="{active:!$parent.hideme}">
<tab-heading>
tab2
</tab-heading>
<div>
tab content 2
</div>
</tab>
</tabset>
コントローラーはこちら
function myController($scope) {
$scope.hideme = false;
});
タブに ng-class が適用されていない場合、最初のタブが非表示で 2 番目のタブが表示される場合 ($scope.hideme = false)、最初のタブのコンテンツがアクティブに表示されることを除いて、うまく機能します。
ng-class を追加すると、angularjs でエラーが発生しました。エラー: [$parse:syntax] http://errors.angularjs.org/undefined/ $parse/syntax?p0=%7B&p1=is%20an%20unexpected%20token&p2=16&p3=%7Bactive%3Afalse%7D%20%7Bactive %3A%20active%2C%20disabled%3A%20disabled%7D&p4=%7Bactive%3A%20active%2C%20disabled%3A%20disabled%7D
特定のタブをアクティブにする正しい方法 (または正しい構文) は何ですか?