**指令中的scope:{}时不是会创建隔离作用域,指令隔离作用域内不能访问父作用域的属性,然而这个竟然能,望高手指点一二,刚上手angular-----**
Surrounding scope: {{ myProperty }}
Inside an directive with inherited scope: {{ myProperty }}
Inside myDirective, isolate scope: {{ myProperty }} **//这里的myProperty竟然也能访问父作用域的myProperty**
Copyright 2014-2026 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
你应该这么写:
按照你的写法,添加了指令的元素并没有按照你的设计被编译。
或者干脆这么写