Home  >  Q&A  >  body text

angular.js - 如何从$scope中的对象属性中找到父节点

例如:
$scope.a=
{

a:{a1:1,a2:2,a3:3},
b:{b1:1,b2:2,b3:3},

}
函数从参数中取得了a3,怎样向上访问取到$scope.a

伊谢尔伦伊谢尔伦2735 days ago662

reply all(1)I'll reply

  • 我想大声告诉你

    我想大声告诉你2017-05-15 17:04:29

    This is not possible, attributes are not unique.

    $scope.a = {
        a: {a1:1, a2:2, a3:3}
        b: {a1:1, a2:2, a3:3}
    }
    
    $scope.b = {
        a: {a1:1, a2:2, a3:3}
        b: {a1:1, a2:2, a3:3}
    }

    So for the above code, what can we get with a3=3?

    reply
    0
  • Cancelreply