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

ng-options with "orderBy" Error: [$rootScope:infdig] #9

Open
benjamin-mueller opened this issue Jan 13, 2015 · 6 comments
Open

ng-options with "orderBy" Error: [$rootScope:infdig] #9

benjamin-mueller opened this issue Jan 13, 2015 · 6 comments

Comments

@benjamin-mueller
Copy link

Hi,

when I try something like

<select2 ng-model="form.channel"
             multiple
             data-allow-clear="true"
             data-placeholder="Channel"
             class="form-control input-sm"
             ng-options="channel._id as channel.name for channel in theChannels | orderBy:'name'">
    </select2>

the dropdown list gets sorted by "name" but in the Console I get multiple

http://errors.angularjs.org/1.3.8/$rootScope/infdig?p0=10

What am I doing wrong?

Thanks for the help

Benjamin

@rubenv
Copy link
Owner

rubenv commented Jan 13, 2015

This is an Angular bug. Same reason why you can't have filter in there.

I wish there was a way on how to support this (a scope variable to a directive with a filter inside), but I haven't found it yet.

So sadly, you're not doing anything wrong. It just doesn't work right now. I really want to be able to support this, but I haven't found a way to fix it yet.

@benjamin-mueller
Copy link
Author

Thanks for the super fast feedback!

I just seems that none of the angular select / select2 directives seem to work 100% which is a real dealbreaker for a production environment.

Anyways, yours is still the most versatile and stable, and since there is always Array.sort() I am very thankful your directive works the way ist does, stable!

Regards

Benjamin

@rubenv
Copy link
Owner

rubenv commented Jan 14, 2015

which is a real dealbreaker for a production environment.

Nah, we're using it in production without any issues. It's just a set of limitations you have to be aware of.

@benjamin-mueller
Copy link
Author

We are too .. but have a look at ui-select2 or ui-select .. they are broken in so many ways .. yours isnt .. :)

@yppeaxy
Copy link

yppeaxy commented Mar 24, 2015

Hi,
Does this mean that we can not use any filters with ng-options?

PS: I also think that your component is the best fit for our production environment.

@CrackerakiUA
Copy link

Just build your own filter, it will work.

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

4 participants