3

I have been looking for an answer for last 4 hours and by gather multiple records I have accomplished few things but it's not working fine. Where am I making a mistake?

View File:

    <?php
    $payment_methods = DB::table('payment_methods')
            ->select('*')
            ->orderBy('created_at', 'desc')
            ->whereNull('deleted_at')
            ->get();
    ?>

    <div style="margin-bottom:20px; display:inline-block;">
              @foreach($payment_methods as $pm)
               <div class=" pay-logo">
                @if($pm->method_name != 'Cash on Delivery')
                    <label>
                      <img class="<% '{{$pm->method_name}}' ==  payment_method ?  'active' : '' %>"     ng-click="selectPayment('{{$pm -> method_name}}')"  src="/assets/marketplace/images/payment/{{$pm -> method_name}}.jpg" alt="" required> 
                      <input style="visibility:hidden;"   type="radio"  name="payment_method"  value="{{$pm->method_name}}"  >
                    </label>
                 @endif
                </div>
             @endforeach
        </div>

Angular JS Code :

$scope.selectPayment = function (payment_meth){
  $http({
         url: "/cart/getInfo?payment_value=" +$scope.payment_method, method: "GET",
       }).success(function (paymentdata){
                if (paymentdata != 'No Description Found'){
                    $scope.payment_value = paymentdata[0];
                    console.log($scope.payment_value.description);
                }
            }).error(function (e){
                console.log(e);
            });
     }
1
  • What do you mean by "it's not working fine"? What error are you seeing and what would you like to see instead? Commented Aug 26, 2016 at 14:38

1 Answer 1

1
<img ng-class="{'active': '<% $pm→method_name %>' == payment_method}" ng-click="selectPayment('{{$pm -> method_name}}')"  src="/assets/marketplace/images/payment/{{$pm -> method_name}}.jpg" alt="" required>
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.