AngularJS指令范围的默认值是什么? [英] What is the default for AngularJS directive scope?
本文介绍了AngularJS指令范围的默认值是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
AngularJS指令的默认作用域值是什么?
What is the default scope value of an AngularJS directive?
当然,它不是孤立的作用域.这是对还是错.
Of course, it is not isolated scope. It is true or false.
我找不到有关它的任何文档.
I can't find any documentation on what it is.
推荐答案
注意,默认情况下,伪指令不会创建新的作用域-即默认值为
scope: false
"
来自了解范围.
使用指令中的scope选项,您可以:
Using the scope option in directive you can:
- create a child scope prototypically inherited with
scope: true
- create an isolated scope with
scope: {}
then you can bind some property to parent scopes with'@', '&', '='
(see this question). - decide to not create a new scope and use parent with
scope: false
(default).
这篇关于AngularJS指令范围的默认值是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文