Yahorow
Yahorow

Reputation: 51

How to get parent of current node Angular UI Tree?

I tried to do that like as:

$scope.showCloneIcon = function(scope)
        {

            if(scope.$parentNodeScope !== null){

                var parent_value = scope.$parentNodeScope.$modelValue.type_value;

                if(parent_value === 'array_objects'){
                    return true;
                }
            }

            return true;
        };

So, it does not hide element where I use ng-show

Upvotes: 1

Views: 929

Answers (1)

user4870812
user4870812

Reputation:

Please try this

$scope.showCloneIcon = function(scope)
{
  if(scope.$parent !== null)
  {
    var parent_value = scope.$parent.$modelValue.type_value;
    if(parent_value === 'array_objects')
    {
      return true;
    }
  }
  return true;
};

Upvotes: 1

Related Questions