-
Notifications
You must be signed in to change notification settings - Fork 13.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
113 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<html ng-app="ionicApp"> | ||
<head> | ||
<meta charset="utf-8"> | ||
<meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width"> | ||
|
||
<title>Radio Buttons</title> | ||
|
||
<link rel="stylesheet" href="../../dist/css/ionic.css"> | ||
<script src="../../../../dist/js/ionic.bundle.js"></script> | ||
</head> | ||
|
||
<body ng-controller="MainCtrl"> | ||
|
||
<ion-header-bar class="bar-positive"> | ||
<h1 class="title">Radio Buttons</h1> | ||
</ion-header-bar> | ||
|
||
<ion-content> | ||
{{ formData }} | ||
<div class="list"> | ||
<ion-radio ng-model="formData.color" ng-value="'red'" name="color">Red</ion-radio> | ||
<ion-radio ng-model="formData.color" ng-value="'blue'" name="color">Blue</ion-radio> | ||
<ion-radio ng-model="formData.color" ng-value="'yellow'" name="color">Yellow</ion-radio> | ||
</div> | ||
</ion-content> | ||
<script> | ||
angular.module('ionicApp', ['ionic']) | ||
.controller('MainCtrl', function($scope) { | ||
$scope.formData = {}; | ||
}); | ||
</script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
<html ng-app="ionicApp"> | ||
<head> | ||
<meta charset="utf-8"> | ||
<meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width"> | ||
|
||
<title>Radio Buttons</title> | ||
|
||
<link href="//code.ionicframework.com/nightly/css/ionic.css" rel="stylesheet"> | ||
<script src="//code.ionicframework.com/nightly/js/ionic.bundle.js"></script> | ||
</script> | ||
</head> | ||
|
||
<body ng-controller="MainCtrl"> | ||
|
||
<ion-header-bar class="bar-positive"> | ||
<h1 class="title">Radio Buttons</h1> | ||
</ion-header-bar> | ||
|
||
<ion-content> | ||
|
||
<div class="list"> | ||
|
||
<div class="item item-divider"> | ||
Clientside, Selected Value: {{ data.clientSide }} | ||
</div> | ||
|
||
<ion-radio ng-repeat="item in clientSideList" | ||
ng-value="item.value" | ||
ng-model="data.clientSide"> | ||
{{ item.text }} | ||
</ion-radio> | ||
|
||
<div class="item item-divider"> | ||
Serverside, Selected Value: {{ data.serverSide }} | ||
</div> | ||
|
||
<ion-radio ng-repeat="item in serverSideList" | ||
ng-value="item.value" | ||
ng-model="data.serverSide" | ||
ng-change="serverSideChange(item)" | ||
name="server-side"> | ||
{{ item.text }} | ||
</ion-radio> | ||
|
||
</div> | ||
|
||
</ion-content> | ||
|
||
<script> | ||
|
||
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); | ||
}; | ||
|
||
}); | ||
</script> | ||
</body> | ||
</html> |
1868141
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Really?! :)