嗨,我有一个旧的工作良好的laravel angular构建项目。但我不知道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>
我尝试了很多,但Angular对我来说是新的,因为我是PHP开发人员,请指导我这样做。 先谢谢。
我自己解决了这个问题,需要对datatable的列属性做一些修改,事情就好办了。