Skip to content
This repository has been archived by the owner on Sep 8, 2020. It is now read-only.

Simple binding with Select2 data object option #276

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Simple binding with Select2 data object option #276

wants to merge 2 commits into from

Conversation

RedJandal
Copy link

I have changed the directive to always bind ng-model to the simple value returned by select2. I have also added a ui-data attribute that enables you to bind a property in your controller to the select2 data object if you need to access it.

Lets say select2 returns the object

{ id: 1, text: "My Selection" }

ng-model will equal 1
ui-data will equal

{ id: 1, text: "My Selection" }

This addresses the following issue

#126

… binds to the select2 value instead of the data object.
@RedJandal RedJandal mentioned this pull request Sep 15, 2014
@Splaktar
Copy link

Unfortunately this change appears to break many of the tests.

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

Successfully merging this pull request may close these issues.

2 participants