Skip to content

fix(directive): priority with value 1 blocks proper loading when inside another directive #50

@mateusleon

Description

@mateusleon

Hello, thanks for you work, I really appreciate it!

I need to alert you for one issue founded when using this kind of priority with angular-select2.

Suppose that you want to provide a directive, with angular-select2 inside it, to handle some common stuff together (e.g.: like a search box, with some filters together, component-like search bundle), and you need to provide options for angular-select2 with a scope variable.

Due to the higher priority of angular-select2, over the wrapper directive one, which isn't even declared (to be added in the queue as it was loaded), those options declared on the scope of the wrapper directive are not available for angular-select2 (are coming undefined on line 55 (https://github.com/rubenv/angular-select2/blob/master/src/select2.js#L55).

Also, these options, if for some reason they need to be changed, it doesn't reflects on angular-select2 instance that's already running.

Plunker to the test case: https://plnkr.co/edit/XxMYjSEuoH9yImawAxhp

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