We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
下面是对文章Tips & Tricks for debugging unfamiliar AngularJS code的摘抄
$($0)
angular.element($0)
$($0).scope()
$($0).scope().$parent
$($0).scope().$parent.$parent
$($0).scope().$root
$($0).isolateScope()
$($0).scope().foo
$($0).scope().hasOwnProperty('foo')
$($0).parent().scope().hasOwnProperty('foo')
$($0).scope().isFoo = true
$($0).scope().$digest()
The text was updated successfully, but these errors were encountered:
其他资料: Debugging AngularJS
Sorry, something went wrong.
No branches or pull requests
Angular Debug 小技巧
下面是对文章Tips & Tricks for debugging unfamiliar AngularJS code的摘抄
查看元素的 scope
$($0)
取得该元素,如果没有导入 JQuery,则用angular.element($0)
。$($0).scope()
返回该元素上的 scope ,可以检查该 scope 中属性。$($0).scope().$parent
查看父 scope , 你也可以通过$($0).scope().$parent.$parent
依次往上查看。$($0).scope().$root
$($0).isolateScope()
查看它的隔离 scope。scope 中的属性来自于哪里
$($0).scope().foo
$($0).scope().hasOwnProperty('foo')
确定属性 foo 是否在当前 scope。$($0).parent().scope().hasOwnProperty('foo')
直达找到为止。当前元素属于哪个 controller
如何让修改过的属性值生效
$($0).scope().isFoo = true
设置 isFoo 属性为 true。$($0).scope().$digest()
迫使 Angular 改变该值。The text was updated successfully, but these errors were encountered: