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

前端 未结 19 1571
渐次进展
渐次进展 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 09:03

    I usually use jQuery data() function for that:

    $($0).data().$scope
    

    The $0 is currently selected item in chrome DOM inspector. $1, $2 .. and so on are previously selected items.

提交回复
热议问题