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

Ion-radio can't read value outside of ion-content

$
0
0

I have here my html:

<ion-content>
  <ion-radio ng-model="termsAgreement" ng-value="'A'">I Agree to the Terms </ion-radio>
  <ion-radio ng-model="termsAgreement" ng-value="'B'">I do not agree</ion-radio>
</ion-content>

<ion-footer-bar>
  <button ng-show="termsAgreement=='A'" ng-model="terms.continueButton" ng-click="showContButton()" class="button button-block button-positive">
    Continue
  </button>
</ion-footer-bar>

ng-show will not work unless I copy and paste button inside of ion-content bar, also I can't access radio values from inside controller unless function is called from radio button its self:

eg this works:

 <ion-radio ng-model="termsAgreement" ng-value="'A'" ng-click="logContent()" >I Agree to the Terms </ion-radio>
 <ion-radio ng-model="termsAgreement" ng-value="'B'">I do not agree</ion-radio>

$scope.logContent = function(){
    console.log(this.termsAgreement);
};

But not this:

 <ion-radio ng-model="termsAgreement" ng-value="'A'">I Agree to the Terms </ion-radio>
 <ion-radio ng-model="termsAgreement" ng-value="'B'">I do not agree</ion-radio>
 <button ng-show="termsAgreement=='A'" ng-click="logContent()" class="button button-block button-positive">
        Continue
      </button>

$scope.logContent = function(){
    console.log($scope.termsAgreement);
  };

Even when button is inside ion-content.

I just can't seem to access the value of radio buttons anywhere in controller and not on page logic except in the case where i use ng-show while button is inside the ion-content

Thanks


Viewing all articles
Browse latest Browse all 228653

Trending Articles