Ask a Question
Ask Question Login
Corporate Training
  1. Community
  2. Devops
  3. Question
Devops

AngularJS access parent scope from child controller

Asked by Rachit Gupta Jul 1, 2021 1.8K views 1 answer
Share

About this question

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 accessing parent properties in the nested HTML by using $parent.vm.property, but I cannot figure out how to access $scope parent property from within my child controller.
I've tried injecting $scope and then using $scope.$parent.vm.property, but this isn't working?


Your answer

1 Answer

More Devops discussions

Learn & Explore

Free tutorials and interview questions from industry experts — learn the skill, then get ready to prove it.

Latest DevOps Blogs

Guides, tips and career advice on DevOps from JanBask experts.