tpl;
{{item.text}}
{{detail[item.name]}}
controller
(function () {
'use strict';
angular
.module('practiceBodyContentList')
.controller('practiceBodyContentListCtrl', practiceBodyContentListCtrl)
.factory('practiceBodyContentListService', practiceBodyContentListService);
practiceBodyContentListCtrl.$inject = ['$scope','$log','$http' ,'PRACTICE_API','practiceBodyContentListService'];
practiceBodyContentListService.$inject = ['$http', 'PRACTICE_API'];
/* @ngInject */
function practiceBodyContentListCtrl($scope,$log, $http, PRACTICE_API, practiceBodyContentListService) {
var ctrl = this;
var data = {};
var pageSize = 1;
$scope.pageChanged = function() {
$log.log('Page changed to: ' + $scope.currentPage);
var page = $scope.currentPage;
get(page,pageSize);
};
$scope.edit = true;
$scope.deleteItem = function(details,detail){
details.splice(detail,1);
// practiceBodyContentListService.delPracticeLists(detail[1].practiceId);
}
$scope.maxSize = 3;
$scope.currentPage=1;
var page = $scope.currentPage;
function get(page,pageSize) {
practiceBodyContentListService.getPracticeLists(page,pageSize).success(function (response) {
$scope.practiceLists = response.data;
// $scope.lists = response.data.list[0];
var detail = [];
for(var i = 0;i
通过ng-repeat制作了一个表格,我想要通过点击删除按钮来删除其中某一条信息,需要给服务器传practiceId,我该怎么获取到这个practiceId呀?
Copyright 2014-2026 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
直接在ngClick的绑定函数中传入就可以啊。。
我是想问为什么要个变量ctrl前面加个'$'符号啊,看着老让我觉得这是个要注入的服务。而且你conroller里面还没这个$ctrl。 看晕了。。。。