Passing parameters in the footer bar


#1

Okay so basically I’m trying to pass parameters whenever a button is clicked and it works fine whenever ion-content tags. So like:

<ion-content>
<button class="button" ng-click="saveAnswer(checkVal1, checkVal2)">Check!</button>
</ion-content>

But I’m trying to make this button within a footer bar which falls outside the ion-content tags and instead of passing the actual parameters it is simply passing undefined.

<ion-view>
<ion-content>
</ion-content>
<button class="button" ng-click="saveAnswer(checkVal1, checkVal2)">Check!</button>
</ion-view>

The parameters I’m looking to pass are set within the ion-content tags, but I’m looking for a way to pass them back to the controller outside of these, any help would be much appreciated

Aaron


#2

Try enclosing your button in <ion-footer-bar></ion-footer-bar>


#3

Okay sorry my bad, that didn’t work, if you attatch the ion-footer-bar tags inside <ion-content></ion-content> it doesn’t stick to the bottom of the screen and outside the ion-content tags it still doesn’t pass the parameters so basically now I have:

<ion-content>
</ion-content>
<ion-footer-bar class="bar-royal">
  <button class="button button-clear" ng-click="saveAnswer(checkVal1,checkVal2)">Next</button>
</ion-footer-bar>

But this isn’t passing the params. Like the ng-click works with functions without params just not with.


#4

cant think of a reason of why this would be happening, check that you havent left any tags open or something otherwise it should work.

Check out this codepen http://codepen.io/paishin/pen/oXeYaj , clearly vars are passed from the controller to the footer just fine.


#5

Didn’t get the parameter passing working so I’ve just implemented a sort of long-winded, not very good solution which will do the job for now, thanks anyway for your help!