ng-disabled not affecting input enabled/disabled when being changed

S Rosam

I am trying to use ng-disabled on an input (either text or number)

<input ng-disabled="{{attribute.selected}}"...

which I have seen working when bound to a checkbox but i cant seem to get it working here.

I have tried without the {{}} but the markup then just contains the 'attribute.selected' instead of true or false

When clicking the md-checkbox i can see in chrome dev tools that the value is changing. ng-disabled="true" then ng-disabled="false"

When using !attribute.selected the inputs are disabled and dont re-enable when the value goes true.

full snippet:

    <md-content layout-padding layout-xs="column">
        <md-checkbox md-ink-ripple="#2199FF" id="attr{{attribute.id}}" ng-model="attribute.selected">
            {{attribute.name}}
        </md-checkbox>

        <md-content layout-padding ng-repeat="property in attribute.properties">

            <md-input-container >
                <label>{{property.name}}</label>
                <input ng-disabled="{{attribute.selected}}" md-maxlength="{{property.maxLength}}" type="{{property.type}}" required name="{{property.name}}" ng-model="property.value">
                <div ng-messages="Required">
                    <div ng-message="required">This is required.</div>
                    <div ng-message="md-maxlength">Max {{property.maxLength}} digits</div>
                </div>
            </md-input-container>

        </md-content>
    </md-content>

</div>

Mickaël VILLERS

change ng-disabled="{{attribute.selected}}" by ng-disabled="attribute.selected"

<md-content layout-padding layout-xs="column">
    <md-checkbox md-ink-ripple="#2199FF" id="attr{{attribute.id}}" ng-model="attribute.selected">
        {{attribute.name}}
    </md-checkbox>

    <md-content layout-padding ng-repeat="property in attribute.properties">

        <md-input-container >
            <label>{{property.name}}</label>
            <input ng-disabled="attribute.selected" md-maxlength="{{property.maxLength}}" type="{{property.type}}" required name="{{property.name}}" ng-model="property.value">
            <div ng-messages="Required">
                <div ng-message="required">This is required.</div>
                <div ng-message="md-maxlength">Max {{property.maxLength}} digits</div>
            </div>
        </md-input-container>

    </md-content>
</md-content>

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

ng-disabled not affecting input enabled/disabled when being changed

From Dev

NgForm.valueChanges is not being triggered when form input values are being changed programatically

From Dev

NdisFSendNetBufferLists causes BSoD when the adapter is being disabled

From Dev

Option not being disabled when I use optionsCaption

From Dev

How to update data on server via AJAX when ng-model input value is changed

From Dev

How to use the event ng-change directive in input text only when the length of the changed value is equal to x?

From Dev

How to use the event ng-change directive in input text only when the length of the changed value is equal to x?

From Dev

Listview not being refreshed when collection changed

From Dev

AJAX not being called when select box changed

From Dev

Capture when disabled property is changed (IE8 compatible)

From Dev

ng-click still fires when div is (ng)disabled

From Dev

Form auto select when input is disabled

From Dev

ng-repeat is not updating when array is changed

From Dev

Select is not updating when ng-model is changed

From Dev

See how the color is being changed with input type=color

From Dev

Angularjs ng-disabled button for several checkbox input

From Dev

Angular - ng-change not firing when ng-model is changed

From Dev

How do I check when an input is changed?

From Dev

onChange event not firing when input changed dynamically

From Dev

Remove contents when input has changed

From Dev

how to update array of objects when input is changed

From Dev

Compute when input gets changed by slider

From Dev

Alert toggles every time when the input is changed

From Dev

JQuery change input when select changed

From Dev

Call method when input text is changed

From Dev

Disable Select Box when text input changed

From Dev

I am not being notified when CaretIndex is Changed in MVVM

From Dev

DateTime object is getting changed when a different variable is being assigned

From Dev

Make oscillations smoothly increase/decrease when frequency being changed dynamically

Related Related

  1. 1

    ng-disabled not affecting input enabled/disabled when being changed

  2. 2

    NgForm.valueChanges is not being triggered when form input values are being changed programatically

  3. 3

    NdisFSendNetBufferLists causes BSoD when the adapter is being disabled

  4. 4

    Option not being disabled when I use optionsCaption

  5. 5

    How to update data on server via AJAX when ng-model input value is changed

  6. 6

    How to use the event ng-change directive in input text only when the length of the changed value is equal to x?

  7. 7

    How to use the event ng-change directive in input text only when the length of the changed value is equal to x?

  8. 8

    Listview not being refreshed when collection changed

  9. 9

    AJAX not being called when select box changed

  10. 10

    Capture when disabled property is changed (IE8 compatible)

  11. 11

    ng-click still fires when div is (ng)disabled

  12. 12

    Form auto select when input is disabled

  13. 13

    ng-repeat is not updating when array is changed

  14. 14

    Select is not updating when ng-model is changed

  15. 15

    See how the color is being changed with input type=color

  16. 16

    Angularjs ng-disabled button for several checkbox input

  17. 17

    Angular - ng-change not firing when ng-model is changed

  18. 18

    How do I check when an input is changed?

  19. 19

    onChange event not firing when input changed dynamically

  20. 20

    Remove contents when input has changed

  21. 21

    how to update array of objects when input is changed

  22. 22

    Compute when input gets changed by slider

  23. 23

    Alert toggles every time when the input is changed

  24. 24

    JQuery change input when select changed

  25. 25

    Call method when input text is changed

  26. 26

    Disable Select Box when text input changed

  27. 27

    I am not being notified when CaretIndex is Changed in MVVM

  28. 28

    DateTime object is getting changed when a different variable is being assigned

  29. 29

    Make oscillations smoothly increase/decrease when frequency being changed dynamically

HotTag

Archive