0

I want to put a "Pay with card" simple Stripe button inside an AngularJS's ng-repeat tag type.

It is working properly when the button is placed outside the ng-repeat div, and opens the Stripe's model popup; but the popup does not opens when I put it inside an ng-repeat tag.

<div ng-if(condition)>
  <form class="" action="/buyer/buyer/StripePayement? 
Amount=500"method="POST"> 
    <article>
     <label>Amount: $500</label>
    </article>
    <script src="//checkout.stripe.com/v2/checkout.js"
      class="stripe-button"
      data-key="pk_test_ryEeHLLIGikPwMiZdK7b0FNf00IbqsyXht"
      data-locale="auto"
      data-description=""
      data-amount="500">
    </script>
  </form>
</div>
Léa Gris
  • 17,497
  • 4
  • 32
  • 41
  • Can you please provide the actual code with the `ng-repeat` tag when the button is inside and when it is outside, and the error messages you are getting in the console if any. – Léa Gris Sep 17 '19 at 11:13

1 Answers1

0

When you have an item inside of an ng-repeat the repeat has its own scope. You likely need to reference the parent scope with $parent like in

Pass parent scope value into ng-repeat loop in Angular

CoGaMa64
  • 20
  • 2