samedi 16 mai 2020

How to add anchor tag in a column before loading angular 1.4 datatable

Hi i have an old fine working laravel angular build project. but i do not know angular js so facing an issue.

my datatable.js is here under

<script>

var app = angular.module('academia', ['ngMessages']);
app.controller('payments_report', function($scope, $http) {

        $scope.initAngData = function() {
            $scope.all_records = 1;
        }

        $scope.setDetails = function(record_id) {
            if (record_id == '')
                return;

            if (record_id === undefined)
                return;
            route = '';
            data = {
                _method: 'post',
                '_token': $scope.getToken(),
                'record_id': record_id
            };
            $scope.payment_record = [];
            $http.post(route, data).success(function(result, status) {
                if (result.status)
                    $scope.payment_record = result.record;
                if ($scope.payment_record.plan_type == 'combo')
                    $scope.payment_record.plan_type = 'Exam Series';
                $scope.other_details = $.parseJSON(result.record.other_details);

                $scope.coupon_applied = "";
                if ($scope.other_details.is_coupon_applied == 1) {
                    $scope.coupon_applied = "";
                }
                if ($scope.name) {
                    $scope.name = "<a href=''>" + $scope.name + "</a>";
                }


            });

        }

        $scope.getToken = function() {
            return $('[name="_token"]').val();
        }
    }
);    
</script>

I tried a lot but angular is new to me as i am php developer please guide me to do this. thanks in advance.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire