angularjs - 如何在加载角度 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 开发人员,请指导我这样做。提前致谢。
解决方案
我自己修好了。需要对数据表的列属性进行一些更改,并且工作正常。
推荐阅读
- kubernetes - kops k8s cluster Kubectl 命令超时问题
- python - 如何使用 python web 抓取在这个 html 中获取公司名称?
- c++ - 在光线追踪中实现反射的问题
- java - 应为 BEGIN_OBJECT,但在第 5 行第 1 列路径 $ 处为字符串。我收到此错误,结果发现任何解决方案都不起作用
- c++ - 为什么不能在函数头中使用双指针作为返回类型?
- reactjs - 在 reactjs 中使用 HOC 内部的 redux 状态
- javascript - TypeError:无法读取 reactjs 中未定义的属性“长度”
- css - 如何阻止 2 个子容器扩展
- python - 当dict(可变dtype)是通过多处理池实现的函数的参数时,为什么python使用'CallByValue'函数调用?
- c++ - 多个遗产断言的可变参数模板 - “...用 3 个模板参数重新声明...”