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

Slider select not working correct with ng-options #207

Open
MartineFrancken opened this issue Jun 14, 2013 · 1 comment
Open

Slider select not working correct with ng-options #207

MartineFrancken opened this issue Jun 14, 2013 · 1 comment
Labels

Comments

@MartineFrancken
Copy link

I've tried using the selectfield in the following way:

` Nee Ja `

If I set klantH on true, the slider will still be set on false (Nee). My goal is to have 'Ja' (true) as default when opening the page.

I am able to achieve this by using ng-options:
<select id="sliderH" name='sliderH' data-role="slider" ng-model="klantH" ng-options="kh.label for kh in khOpties"> </select>

with
$scope.khOpties = [ { label : 'Nee', value : false }, { label : 'Ja', value : true }]
and
$scope.klantH = $scope.khOpties[1];

It does set the right option in the slider, but I do lose a lot of mark-up. I don't see the labels and the color for the true-value isn't different from the false-value.

How can I set the slider on 'true' with the right rendering of slider?

@tbosch
Copy link
Contributor

tbosch commented Jun 27, 2013

Hi,
if you set klantH='true' this also works with <option>s. See this fiddle: http://jsfiddle.net/4AEQK/10/

Using ng-options seems to work correctly, as far as I can tell: http://jsfiddle.net/4AEQK/11/

Could you create a js fiddle that reproduces your problem?

Thanks,
Tobias

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