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

can't get selected value using single selection mode #32

Closed
c0debreaker opened this issue Jun 25, 2014 · 3 comments
Closed

can't get selected value using single selection mode #32

c0debreaker opened this issue Jun 25, 2014 · 3 comments
Labels

Comments

@c0debreaker
Copy link

Hi,

I made a dropdown using your example on number 5, Single selection mode with no helper elements, just like a normal drop down menu.

I can't figure out which value will contain the selected menu. I tried $scope.name but it was undefined. I tried output-model but it's for multiple selections.

Any help would be greatly appreciated!

@c0debreaker
Copy link
Author

Here is my workaround. It works but I'm not sure if it's the right approach

    $scope.close = function() {
        console.log( 'multi-select: on-close' );
        $scope.selected = $scope.singleWebBrowsers.filter(function(thing) {
            return thing.ticked
        });
    }

then on my template, I'm using

{{selected[0].name}}
though I won't really use the variable in the template.

I'm actually going to use it as an input to a SQL query statement

@c0debreaker
Copy link
Author

You can close this ticket. The solution I'm using is good enough.

@isteven
Copy link
Owner

isteven commented Jun 25, 2014

Hi @c0debreaker ,

Easiest way to get the selected item:

loop your-input-model:
    if your-input-model.your-tick-property === true then
        // process data here
        ...
        ...
        break; // since this is a single selection mode then we no longer need to process the rest
    end if
end loop

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

No branches or pull requests

2 participants