Angularjs 如何使用angular ui jquery passthrough使带有指令内部步骤的formwizard正常工作?

Angularjs 如何使用angular ui jquery passthrough使带有指令内部步骤的formwizard正常工作?,angularjs,jquery-form-wizard,angular-ui,Angularjs,Jquery Form Wizard,Angular Ui,我用表单向导尝试了jquerypassthrough,效果非常好。然而,现在我有一个问题。当formwizard中的步骤位于指令内部时,jquery传递似乎不起作用(显示所有步骤,而不是仅显示第一个步骤): 和向导_step.html: <fieldset class="step" id="step{{stepNumber}}"> Some html </fieldset> 一些html 就像我前面说的,所有的步骤都会一直显示。我认为这是某种时间问题,比如当

我用表单向导尝试了jquerypassthrough,效果非常好。然而,现在我有一个问题。当formwizard中的步骤位于指令内部时,jquery传递似乎不起作用(显示所有步骤,而不是仅显示第一个步骤):

和向导_step.html:

<fieldset class="step" id="step{{stepNumber}}">
    Some html
</fieldset>

一些html

就像我前面说的,所有的步骤都会一直显示。我认为这是某种时间问题,比如当jquerypassthrough尝试初始化formwizard时,指令或include不完全在dom中。这就是正在发生的事情吗?如果是这样,我是否应该在某处使用$timeout?如果是,我会把它放在哪里。也许有更好的办法。有什么想法吗?

答案是,不要将formwizard用于angularJS:)。在进一步研究了ng开关之后,它不仅完成了工作,而且简化了很多东西

<form ng-switch="navStep" class="main">
    <!--STEP 1 -->             
    <div ng-switch-when="activity_info" activity-wizard-step title="Class Activity Info" description="Add all info about the activity" src="resources/angular/templates/activity_wizard/activity_info.html" step-number="1"></div>

    <!-- STEP 2 -->
    <div ng-switch-when="add_class" activity-wizard-step title="Add Class(es)" description="dd Instructor-Led-Training (ILT) Classes below. It can be a classroom ILT or a Webinar ILT and contain 1 or more sessions." src="resources/angular/templates/activity_wizard/add_class.html" step-number="2"></div>

</form>

然后在设置导航步骤中,单击“下一步”和“上一步”按钮


基本上,angular的强大性使formwizard变得不必要。

我还没有测试,但我认为您的问题可能在于
id
属性:
id=“step{{{stepNumber}}”
angular提供了类似
ng href
ng class
的ng属性,它们告诉它首先编译表达式。我认为您的指令可能会将
id
作为
的“step{{stepNumber}}”
而不是替换的versionYeah,我检查了一下,它实际上得到了正确的编号。如何在directve的templateUrl中加载src属性?我不确定您在问什么。在我的活动向导步骤中,我有一个ng include,并将src属性传递给它。那有用吗?是的。我以为您在指令中将src属性值传递给了templateUrl。。。
<fieldset class="step" id="step{{stepNumber}}">
    Some html
</fieldset>
<form ng-switch="navStep" class="main">
    <!--STEP 1 -->             
    <div ng-switch-when="activity_info" activity-wizard-step title="Class Activity Info" description="Add all info about the activity" src="resources/angular/templates/activity_wizard/activity_info.html" step-number="1"></div>

    <!-- STEP 2 -->
    <div ng-switch-when="add_class" activity-wizard-step title="Add Class(es)" description="dd Instructor-Led-Training (ILT) Classes below. It can be a classroom ILT or a Webinar ILT and contain 1 or more sessions." src="resources/angular/templates/activity_wizard/add_class.html" step-number="2"></div>

</form>