Skip to content
This repository was archived by the owner on Apr 30, 2018. It is now read-only.
This repository was archived by the owner on Apr 30, 2018. It is now read-only.

Set disable in controller doesn't work as expected #769

@wyx2000

Description

@wyx2000

I need dynamically load a select, but before the list is populated, I don't want user click into it and see a blank dropdown. So I move the loading code to controller, only set disable to false when the list is populated.
But with the below code, I can get the list populated, but the set disable to false doesn't work.

{
    type: 'select', key: 'ref_code', defaultValue: '', templateOptions: {
        'required': false, 'label': 'Supporter', 
        'options': [], 'disabled': true 
    },
    controller: function ($scope) {
        $scope.to.loading = parentScope.ensure_option('resellers').then(function (items) {
            $scope.to.options = options.get('resellers');
            $scope.options.templateOptions.disabled = false; 
            return $scope.to.options;
        });
    }
},

Any idea?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions