Bilal Awan Bilal Awan - 2 months ago 31
AngularJS Question

dropdown of choices works ok in browser but not open options to select in mobile devices not even in chrome device mode

here is my code of view and controller respectively

<select ng-model="selectedItem" ng-options="option for option in typeOptions" ng-change="changeDateRange()" ng-init="selectedItem = typeOptions[0]"></select>

$scope.typeOptions = [
{ name: 'Feature', value: 'feature' },
{ name: 'Bug', value: 'bug' },
{ name: 'Enhancement', value: 'enhancement' }
];

Answer

I'm not sure how this worked for you in your browser but check this out. (I used Jade syntax, but you can easily adapt it to html)

(function(){
  'use strict'
  angular
    .module('app', [])
    .controller('appController', ['$scope', function($scope){

      $scope.typeOptions = [
        { name: 'Feature', value: 'feature' }, 
        { name: 'Bug', value: 'bug' }, 
        { name: 'Enhancement', value: 'enhancement' }
       ];
    }])
})()


div(data-ng-app="app")
 div(ng-controller="appController")
   select.form-control(ng-model="selectedItem", ng-options="option.value as option.name for option in typeOptions track by option.value" ng-init="selectedItem=typeOptions[0]")

Hope this helps. Here's also the codepen link: http://codepen.io/alex06/pen/XjarJd