Quantcast
Channel: Ionic Forum - Latest posts
Viewing all articles
Browse latest Browse all 228595

Ion-radio with checked="true" does not work?

$
0
0

Try do it:

view:
< ion-radio ng-repeat="user in userAnswers" ng-value="user.answer" ng-model="finalAnswer">{{ user.text }}< /ion-radio>

controller:
$scope.userAnswers = [
{ text: "Backbone", answer: "bb" },
{ text: "Angular", answer: "ng" },
{ text: "Ember", answer: "em" },
{ text: "Knockout", answer: "ko" }
];
$scope.finalAnswer = 'ng';

I think the ionic 2 is something like:
export class MainCtrl{
constructor(){
this.userAnswers = [
{ text: "Backbone", answer: "bb" },
{ text: "Angular", answer: "ng" },
{ text: "Ember", answer: "em" },
{ text: "Knockout", answer: "ko" }
];

    this.finalAnswer = 'ng';
}

}

http://ionicframework.com/docs/v2/components/#radio
https://github.com/driftyco/ionic-site/tree/master/dist/preview-app/app/inputs/radio


Viewing all articles
Browse latest Browse all 228595

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>