Search code examples
angularjsionic-frameworkfooter

Ionic switch between 2 footers


I have this in the footer :

<div class="bar bar-footer bar-assertive" ng-show="withdarawStatus">
    <button class="button button-assertive" id="applyButton" ng-click="withdraw()">
        Successfully Applied! Withdraw? 
    </button>
</div>    

<div class="bar bar-footer bar-positive" ng-show="!withdarawStatus" >
    <p id="applyButton" >Application Withdrawn</p>
</div>

I want to write a function that when I click withdraw() the footer changes to "Application Withdraw" footer.

I tried this but it didn't work, unless i reload the entire page.

$scope.withdraw = function() {
    $scope.withdrawStatus = true;
}

Solution

  • You have a typo in your HTML ng-show="!withdarawStatus" should be ng-show="!withdrawStatus". That should fix the issue.

    Edit: Here's a working codepen