How to access $scope variable in angular from chrome console

后端 未结 4 1775
日久生厌
日久生厌 2021-01-30 20:18

How to access the scope variable widgets from chrome\'s console

function MyCntrl($scope) {
    $scope.widgets = [
        {text:\'Widget #1\', datarow:1, dataco         


        
4条回答
  •  长情又很酷
    2021-01-30 21:13

    The scope is bound to the DOM so you need to grab an element and use some angular code to get the scope.

    Your best bet is to get an element that the Controller is bound to and have a look at the scope on that.

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

提交回复
热议问题