Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

ionic Radio Button Operations

ionic Radio Button Operations

In the example, different values are displayed according to the different selected options.

HTML Code





  

当选按钮

选取的值为: {{ data.clientSide }}
{{ item.text }}
Serverside, Selected Value: {{ data.serverSide }}
{{ item.text }}

JavaScript Code



angular.module('ionicApp', ['ionic'])



.controller('MainCtrl', function($scope) {



  $scope.clientSideList = [

    { text: "Backbone", value: "bb" },

    { text: "Angular", value: "ng" },

    { text: "Ember", value: "em" },

    { text: "Knockout", value: "ko" }

  ];



  $scope.serverSideList = [

    { text: "Go", value: "go" },

    { text: "Python", value: "py" },

    { text: "Ruby", value: "rb" },

    { text: "Java", value: "jv" }

  ];

  

  $scope.data = {

    clientSide: 'ng'

  };

  

  $scope.serverSideChange = function(item) {

    console.log("Selected Serverside, text:", item.text, "value:", item.value);

  };

  

});

css code:



body {

  cursor: url('http://www.runoob.com/try/demo_source/finger.png'), auto;

}

The effect is shown below: