How do I access the $scope variable in browser's console using AngularJS?

前端 未结 19 1578
渐次进展
渐次进展 2020-11-22 08:35

I would like to access my $scope variable in Chrome\'s JavaScript console. How do I do that?

I can neither see $scope nor the name of my mo

19条回答
  •  天涯浪人
    2020-11-22 08:43

    I agree the best is Batarang with it's $scope after selecting an object (it's the same as angular.element($0).scope() or even shorter with jQuery: $($0).scope() (my favorite))

    Also, if like me you have you main scope on the body element, a $('body').scope() works fine.

提交回复
热议问题