が解決を参照してくださいにするためにtest.html
からng-show
を削除した - (Punkler更新日)
私は
onload
で
ng-include
を使用
http://plnkr.co/edit/6p1dVln2R9Pgb9ivoMcX?p=preview
:
ng-if
で
<!-- Jquery Steps HTML Template -->
<div id="wizard" ng-controller="wizardCtrl">
<h3><i class="fa fa-question-circle" aria-hidden="true"></i> Arroz</h3>
<section>
<div ng-if="index == '1'" ng-include="'test.html'" onload="finishLoading()"></div>
</section>
</div>
<script>
// Jquery Steps Plugin
$wizard = $("#wizard");
$wizard.steps({
headerTag: "h3",
bodyTag: "section",
enableFinishButton: false,
enablePagination: true,
enableAllSteps: false,
forceMoveForward: true,
titleTemplate: "#title#",
cssClass: "wizard tabcontrol",
labels: {
loading: ""
}
});
angular.module('myApp', [])
.controller('wizardCtrl', ['$scope', '$timeout', function($scope, $timeout){
$scope.index = "1";
$scope.finishLoading = function(){
// jQuery Steps
var index = $wizard.steps("getCurrentIndex");
// ...
return true;
};
}]);
</script>
、あなたはオンデマンドのタブのコンテンツをロードすることができ、つまり、あなたは現在を取得するためにgetCurrentIndex
と呼ばれるjQueryのステップメソッドを使用することができますステップインデックス。 autoload
を使用して< Steps Methods>
は非同期コンテンツ負荷のonContentLoaded
メソッドをオーバーライドします。 < Steps Events>
AngularまたはjQueryを使用してください。 jQueryを完全に削除してください。それが解決策です。 –
jQueryを削除する必要はありませんが、テンプレートがロードされた後にangleが実行されていることを確認する必要があるため、非同期ロードの角度を使用する必要があります。ここでは、ディレクティブを使用して非同期的にテンプレートを読み込むソリューションを提案する記事があります。 http://stackoverflow.com/questions/21196245/load-angular-directive-template-async –