0

次のオプションを使い果たしました。

ng-disabled を使用すると、値が {false, true, disabled, enabled} の場合、要素は常に有効になります。

disabled を使用すると、値が {false, true, disabled, enabled} の場合、要素は常に無効になります。

これが私のサンプルコードです。これを解決するのを手伝ってください。

<div class="container container-mobile_content ">
    <div class="module module-mobile_content ">
    <form name="initialForm" novalidate>
        <div class="copy">
            <br>

            <p class="module-mobile_content">
                <span translate="label.registration.text.1.1"/>
            </p>
            <br>
            <div class="module-mobile_content" ui-view/>
            <br/>
            <div class="module-form">
                <b><span translate="label.policynumber"></span></b>
                <input type="text" name="policyNumber" ng-model="user.policyNumber" required/>
                <span style="color: #ce0803; font-size:x-small" ng-show="initialForm.policyNumber.$error.required">*required</span>
                <br>
                <br>
            </div>

            <button ng-click="validatePolicy()" ng-disabled="initialForm.$invalid">{{ 'message.next' | translate }}{{initialForm.$invalid}}</button>

        </div>
    </form>
    </div>
</div>
4

1 に答える 1

1

この問題は、翻訳フィルターまたは角度バージョンに関係していると思います。

この plunkを調べてください。これは正確なコードであり、変換フィルターを使用せず、Angular 1.0.8 を使用しています (以前の製品バージョン、1.0.6 は非推奨です)。

于 2013-11-14T08:30:57.633 に答える