Harry
Harry

Reputation: 17

ng-disabled is not disabling a button in Angular JS 1.0.6?

I have tire out the following options,

if we use ng-disabled the element will always be enabled when the value are {false, true, disabled, enabled}.

if we use disabled the element will always be disabled when the value is {false, true, disabled, enabled}.

Here is my Sample code please help me to resolve this,

<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>

Upvotes: 0

Views: 1208

Answers (1)

Oleg Belousov
Oleg Belousov

Reputation: 10111

I believe that the issue has something to do with your translate filter, or\and to the angular version.

Please examine this plunk, it is your precise code, without the translate filter, and with angular 1.0.8(previous production version, 1.0.6 is deprecated)

Upvotes: 1

Related Questions