How to access $scope variable in angular from chrome console

后端 未结 4 1776
日久生厌
日久生厌 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条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-01-30 21:15

    Here is one Example: I have following DOM on my angular Single Page application:

    Roles

    and this div is present in the controller name usersAppController as uac Above here I have controller as syntax

    Also note down that I am using jQuery in my application:

    $($0).controller() method will give me a direct access to the uac object which is on the $scope object.

    $($0).scope() will give me prototype chain for the element I have selected and if I follow that chain I will find my scope object on that element.

提交回复
热议问题