我刚开始学习angularJS。我有一个创建了一个ui-tree来显示来自后端的数据。我必须在点击它时显示该元素的详细信息。但我遇到访问特定节点(元素)的问题。
有人可以描述ui-tree的基础知识(不是angularjs.org的文档)以及如何从树中访问特定节点?
angular.module("affiliatePortal.controllers").controller("manageProductController", ["$scope", "productService","$state","$rootScope",
function($scope, productService, $state, $rootScope) {
$scope.data = [];
productService.findAll().then(function(product) {
for (var i = 0; i < product.length; i++) {
var productName = {
"id" : product[i].id,
"title" : product[i].productType,
"paymentType": product[i].paymentType,
"paymentBasis": product[i].paymentBasis
}
$scope.data.push(productName);
}
});
}]);
&#13;
<div ui-tree>
<ol class="affiliate-list" ui-tree-nodes="" ng-model="data" id="tree-root">
<li class="row" ng-repeat="node in data" ui-tree-node data-nodrag ng- include="'partials/directives/userNode.html'"></li>
</ol>
</div>
&#13;