0
我正在開發一個表單,如果此嚮導按鈕爲true,那麼會出現一個「嚮導按鈕」,表單呈現爲嚮導。Angularjs條件嚮導
有避免代碼重複的簡單方法嗎?
爲例:
<wizard on-finish="saveit()" ng-if="data.form.config.wizardmode">
<wz-step title="Starting" ng-if="$index==0 && data.form.config.wizardmode">
<h1>This is the first step</h1>
<p>Here you can use whatever you want. You can use other directives, binding, etc.</p>
<input type="submit" wz-next value="Continue" />
</wz-step>
<wz-step title="Continuing">
<h1>Continuing</h1>
<p>You have continued here!</p>
<input type="submit" wz-next value="Go on" />
</wz-step>
<wz-step title="More steps">
<p>Even more steps!!</p>
<input type="submit" wz-next value="Finish now" />
</wz-step>
</wizard>
如果嚮導的時候,我將不得不重新編寫整個形式? 有沒有一個很好的邏輯(角度的方式)基本上隱藏/顯示所有<wz-step>
標籤?
謝謝,Patrick
你可以爲每個表格做一個指令 – 2014-09-02 16:53:49
但我還有兩種形式? – 2014-09-02 17:54:46
你將有2個表格,但你只會寫一次 – 2014-09-02 17:56:47