I have the following code that shows me a series of hours from 07 to 22. What I want to know is how to get the value of the time selected in my controller and if it is possible to print on an alert.
Vista html
<div ng-controller="MyCtrl">
<div class="item item-divider item-positive item-text-wrap">
HORA INGRESO
</div>
<div class="row">
<div class="col .col-50">
<div class="item item-input item-select">
<div class="input-label">HH</div>
<select ng-model="data.hih" ng-init="data.hih=horas[0]" ng-options="hih.hora for hih in horas">
</select>
</div>
</div>
</div>
<a class="button button-block icon-left ion-ios-compose button-balanced"
ng-click="crearTutoria()">
Crear Tutoría
</a>
</div>
Controller
var myApp = angular.module('myApp',[]);
//myApp.directive('myDirective', function() {});
//myApp.factory('myService', function() {});
function MyCtrl($scope) {
$scope.horas = [];
for(var i=7;i<=22;i++){
if(i<10){
$scope.iconcatenado='0'+i;
$scope.horas.push({hora:$scope.iconcatenado});
}else{
$scope.horas.push({hora:i});
}
}
$scope.data = {};
//9.1 hace referencia al data de CrearTutoria.html
$scope.crearTutoria=function(){
alert($scope.data.hih)//esto me muestra [Object:Object]
alert(JSON.stringify($scope.data.hih))// me imprime hora:07 y lo que solo quiero obtener es 07 o el cualquier valor seleccionado
}
}