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

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

Open
wyx2000 opened this issue Mar 5, 2018 · 0 comments
Open

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

wyx2000 opened this issue Mar 5, 2018 · 0 comments

Comments

@wyx2000
Copy link

wyx2000 commented Mar 5, 2018

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?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant