Angularjs 向导隐藏 wz-step

Angularjs Wizard hide wz-step

如何根据上一步的值隐藏 wz-step

我的HTML:

<wizard on-finish="submit()" hide-indicators="true" currentStep="data"> 
 <wz-step wz-title="onestep">
  <p>Show two step?</p>
  <md-radio-group ng-model="data.question" class="md-primary">
  <md-radio-button ng-value="1"> Yes </md-radio-button>
  <md-radio-button ng-value="0"> No </md-radio-button>
  </md-radio-group>
  <md-button type="submit" wz-next>NEXT</md-button>
 </wz-step>
 <wz-step wz-title="twostep" ng-show="data.question == 1">
    //Two step, show if data.question = 1
 </wz-step>
 <wz-step wz-title="finalstep">
  <md-button type="submit" wz-next class="md-raised">Submit</md-button>
 </wz-step>
</wizard>

我的js: scope.data = { 问题: 0, };

我试过 ng-show 和 ng-if,ng-show 总是显示,而 ng-if 从不显示:(

希望你能帮助我,在此先感谢。

当用户点击下一步时,您可以使用 ng-hide。

例如:

 <div ng-hide = "show">
          <input type="text" ng-model="test"/>
 </div>

<input type="button" ng-click="MyFunction" value="Next">

控制器:

$scope.show = false;
$scope.MyFunction = function(){
    if($scope.test == null){ // or undefined...
          $scope.show = true;
    }
};

只是阅读缺少的文档 https://github.com/angular-wizard/angular-wizard 向导动态步骤 谢谢 Edith Capistran