Git Product home page Git Product logo

ember-chosen's People

Contributors

clockwerx avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Forkers

clockwerx

ember-chosen's Issues

Don't require an array of objects

Often my label and value are the same, thus it would be convenient pass a collection of strings to content. Unfortunately doing so causes:

Uncaught Error: Assertion Failed: When using @each to observe the array SOME, STRINGS, HERE, the array must return an object

You get that regardless of whether you:

  • Omit optionLabelPath and optionValuePath, or:
  • You specify optionLabelPath='content' optionValuePath='content'.
    This isn't documented, it just seemed to be the 'common sense' approach.

My current workaround is to wrap the content array, thus:

stuffContent: function() {
  return _.map(this.get('stuff'), function(o) {
    return { name: o };
  });
}.property('stuff')

So I can then use:

{{chosen content=stuff optionLabelPath='content.name' optionValuePath='content.name'}}

But that's a lot of work, when it could just be:

 {{chosen content=stuff}}

I believe this is specific to ember-chosen (not chosen in general).
Further I'm not sure if it's unsupported, or just undocumented?

Should also observe the selection binding

Hi,
I have a chosen select and a collection of models.

Content doesn't change, but the selection does.

IE:

chosen content=unchangingOptionList selection=model.selectedTags

btn click="prev"
 | Prev

btn click="next"
 | Next

Since content doesn't change, the wrong selection is rendered to users.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.