AngularJS access parent scope from child controller

前端 未结 9 1894
南方客
南方客 2020-11-22 07:30

I\'ve set up my controllers using data-ng-controller=\"xyzController as vm\"

I have a scenario with parent / child nested controllers. I have no problem

9条回答
  •  梦如初夏
    2020-11-22 08:01

    I've just checked

    $scope.$parent.someProperty
    

    works for me.

    and it will be

    {{$parent.someProperty}}
    

    for the view.

提交回复
热议问题