Is it possible in Angular to change the value of $scope.complete
to false
when a specific URL is clicked by the user?
I display a credit card form based on the value of this variable. Initially, the value is set to true or false depending on the data from the server side indicating if there is a credit card on file.
If there is a credit card on file, I want to include a change
link. When this link is clicked, the value of $scope.complete
should be changed to false and the credit card form will be shown.
This is my current code:
JS
$scope.complete = false;
djangoAuth.profile().then(function(data){
$scope.model = data;
if ($scope.model.profile.stripe_id.length <= 0)
$scope.complete = false;
else
$scope.complete = true;
});
html:
<div ng-if="complete == false">
<!--show form-->
</div>
<div ng-if="complete == true">
Credit card already on file. <a href="#">Change?</a>
</div>