angularjs指令范围默认值? [英] angularjs directive scope default value?
本文介绍了angularjs指令范围默认值?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
什么是angularjs指令的默认值范围?
当然,它不是孤立的范围。这是真的还是faluse。
我找不到它是什么任何文件
解决方案
注意,默认情况下,指令不会创造新的范围 - 即默认为
范围:假
块引用>在指令使用的范围选项,您可以:
- 创建一个子范围与
中典型继承范围:真正的
- 创建与
范围的隔离范围:{}
,那么你可以将某些属性的父作用域绑定'@','和;, '='
(见<一href=\"http://stackoverflow.com/questions/14908133/what-is-the-difference-between-vs-and-in-angularjs\">this问题)。- 决定不创建一个新的范围,并使用与父
范围:假
(默认)What is the default scope value of an angularjs directive?
Of course, it is not isolated scope. It is true or faluse.
I can't find any documentation on what it is
解决方案"Note, by default, directives do not create new scope -- i.e., the default is
scope: false
"from Understanding scopes.
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屋!
查看全文