如何获取当前节点Angular UI Tree的父级?

时间:2017-06-13 06:36:07

标签: angularjs angular-ui-tree

我试着这样做:

$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;
        };

因此,它不会隐藏我使用ng-show

的元素

1 个答案:

答案 0 :(得分:1)

请试试这个

$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;
};
相关问题