JSFiddle - React, Tailwind, and code Playground
by shaoran
HTML
<b>Time:</b>
<select ng-options="hour.label for hour in hours track by hour.val" ng-model="new_hour"></select> HH :
<select ng-options="minute.label for minute in minutes track by minute.val" ng-model="new_minute"></select> MM :
<select ng-options="minute.label for minute in minutes track by minute.val" ng-model="new_second"></select> SS
<hr>
new_hour = {{ new_hour }}<br>
new_minute = {{ new_minute }} <br>
new_second = {{ new_second }} <br>
<hr>
<button ng-click="f1()">Test 1</button>
JavaScript
var app = angular.module("myTest1", []);
app.controller("myController", function($scope) {
$scope.minutes = [];
for(var i = 0; i < 60; ++i)
{
var min = String(i);
if(i < 10)
min = "0" + min;
$scope.minutes.push({ val: i, label: min});
}
$scope.hours = $scope.minutes.slice(0, 24);
$scope.new_minute = $scope.minutes[0];
$scope.new_hour = $scope.hours[0];
$scope.new_second = $scope.minutes[0];
$scope.f1 = function() {
console.log("f1: new_second: " + $scope.new_second.val)
}
});