Skip to content

Sharing options model amongst multiple selectize #63

Closed
@miketeix

Description

@miketeix

The $watch on scope.options inside of onInitialize wasn't firing for me.

Line 106
        scope.$watch('options', function(){
          selectize.clearOptions();
          selectize.addOption(scope.options)
          selectize.setValue(scope.ngModel)
        }, true);

I believe it was because the reference $scope.options in my controller was being overwritten from within angular-selectize here:

Line 92 
scope.options = generateOptions( (scope.options || config.options || scope.ngModel).slice() );

I'm going to submit a pull-request with the changes that worked for me - would like to know what you think. Thanks again for this clean directive, Cheers!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions