这是我的AngularJS ng-click函数不起作用。我需要通过这个功能来获得branch.id
:角度onclick传递值
<tr data-id="0" ng-model="row1" ng-repeat="branch in details | filter:branchsearch | limitTo:10" style="border-bottom:1px solid ;">
<td style="display: none">{{branch.branch_id}}</td>
<td ng-click="getid(branch.branch_id)" class="tablerow"> {{branch.name}}</td>
<td ng-click="getid(branch.branch_id)" class="tablerow"> {{branch.code}}</td>
<td ng-click="getid(branch.branch_id)" class="tablerow"> {{branch.t_name}}</td>
<td ng-click="getid(branch.branch_id)" class="tablerow"> {{branch.city}}</td>
</tr>
而且还有我的角度的功能,这是不工作:
<!-- begin snippet: js hide: false console: true babel: false -->
var adminmodule = angular.module("adminmodule",[]);
// Branch Controller
adminmodule.controller("branchcontroller",['$scope','$http','$filter', function ($scope, $http,$filter) {
branchinfo();
function branchinfo(){
// Sending request to branchinfo.php files
$scope.currentPage = 0;
$scope.pageSize = 10;
$http.post('http://localhost/sms1/adminAsset/script/branchinfo.php').success(function(data){
// Stored the returned data into scope
$scope.details = data;
});
}
$scope.getid=function (id) {
alert(id+'haris Done');
}
$scope.numberOfPages=function(){
return Math.ceil($scope.getData().length/$scope.pageSize);
}
}]);
'NG-modal'? 'ng-model'错字?或模态插件? – tymeJV
发布你的控制器代码 – MaazKhan47
@tymeJV你在说什么??????? –