ionic

by venujoginpally

HTML

<script src="http://code.ionicframework.com/1.0.0-beta.6/js/ionic.bundle.js"></script>
<link rel="stylesheet" href="http://code.ionicframework.com/1.0.0-beta.6/css/ionic.css">
<div>
    <div ng-app="sampleApp">
        
      <ion-list ng-controller="TestCtrl">

    <label class="item item-input item-select">
        <div class="input-label">
            {{countSelector}}
        </div>
        <select ng-model="countSelector" ng-change="changeCount('{{countSelector}}')" ng-options="opt as opt.label for opt in options">
        </select>
    </label>

</ion-list>
    </div>
</div>

JavaScript

var SampleApp;
(function (SampleApp) {

    var app = angular.module('sampleApp', ['ionic']);
    app.controller('TestCtrl', function($scope) {
    $scope.options = [
        { id: 0, label: '15', value: 15 },
        { id: 1, label: '30', value: 30 },
        { id: 2, label: '60', value: 60 }
    ]

    $scope.countSelector = $scope.options[1];

    $scope.changeCount = function(obj){
        obj = JSON.parse(obj);
        console.log(obj)
        console.log($scope.countSelector)
      
    };
    
})

})(SampleApp || (SampleApp = {}));