首页 > 解决方案 > 如何在加载角度 1.4 数据表之前在列中添加锚标记

问题描述

嗨,我有一个旧的、工作良好的 laravel 角度构建项目。但我不知道 angular js 所以面临一个问题。

我的 datatable.js 在下面

<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 = '{{URL_GET_PAYMENT_RECORD}}';
            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 = "{{getPhrase('no')}}";
                if ($scope.other_details.is_coupon_applied == 1) {
                    $scope.coupon_applied = "{{getPhrase('yes')}}";
                }
                if ($scope.name) {
                    $scope.name = "<a href='{{URL_USER_DETAILS.$p->slug}}'>" + $scope.name + "</a>";
                }


            });

        }

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

我尝试了很多,但角度对我来说是新的,因为我是 php 开发人员,请指导我这样做。提前致谢。

标签: angularjslaravel-5

解决方案


我自己修好了。需要对数据表的列属性进行一些更改,并且工作正常。


推荐阅读