I have a problem getting the equivalent timezone assigned in my model. In my question below, the value of the model timeSetting.timezone which is 34 is from a cgi response. How will I call the respective timezone value assigned to 34 in the dropdown list to also be the value displayed in the input box? There immes an associated plunker in the answer part of my other question.
<body ng-controller="MainCtrl"> <select class="select len_lg" ng-model="timezone"> <option value="1">(GMT-12:00) International Data Line West; </option> <option value="2">(GMT-11:00) UTC-11; </option> <option value="3">(GMT-11:00) Samoa;</option> <option value="4">(GMT-10:00) Hawaii;</option> <option value="5">(GMT-09:00) Alaska; </option> <option value="6">(GMT-08:00) Baja California;</option> <option value="34">(GMT-08:00) Pacific Time (US & Canada);</option> </select> timezone: {{timezone}} </body> <script>var app = angular.module('plunker', []); app.controller('MainCtrl', function($scope) { $scope.timezone = '34'; }); </script>
how to select the data from dropdown list that is equivalent to the ng-model in angularjs
No comments:
Post a Comment