0

I have just started to learn angularJS. I have a created a ui-tree to show data from backend.I have to display the details of the element on click of it. But I am facing problem with accessing a particular node(element).

Can someone describe the basics of ui-tree(not the documentation from angularjs.org) and how to access a particular node from the tree?

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);
	    }
	});
	
}]);
<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>

2

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.