Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

If you're using an id/name combination the model becomes the whole json object not just the model #17

Open
owlyowl opened this issue Nov 4, 2014 · 1 comment

Comments

@owlyowl
Copy link

owlyowl commented Nov 4, 2014

   <div class="ac-select" ac-model="itemListing.selectedVideo.productId" ac-key="id" ac-options="p.id as p.name for p in productListing.products" data-ac-settings="{ loadOnOpen: true, minWidth: '300px' }"></div>

                                {{ itemListing.selectedVideo.productId }}

If I set this up and trying an output itemListing.selectedVideo.productId it will return the entirety of the selectedVideo object not just the productId

I've tried using ac-key with the same result..

@john-oc
Copy link
Owner

john-oc commented Nov 6, 2014

Yes, this is a limitation at the moment, due to the custom implementation of the ac-model and ac-options attributes. I think you'll need to use the selectedVideo object as the model and then access the productId in the js.

I'm considering changing to the standard ng-model and ng-options and making them consistent with the standard angular select, but that will take a while and would be a breaking change.

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

No branches or pull requests

2 participants