给定container1
带有transclude 的指令()和一个隔离的范围,当指令链接时,我有这些范围:
Scope 004 <-- scope of the body
Scope 005 <-- scope of directive container1
Scope 006 <-- scope of the ng-transclude
Run Code Online (Sandbox Code Playgroud)
我期望:
Scope 004 <-- scope of the body
Scope 005 <-- scope of the directive
Scope 006 <-- scope of the ng-transclude
Run Code Online (Sandbox Code Playgroud)
如果同一指令具有共享范围而不是隔离范围,则会得到预期结果.
这导致了一个问题,因为如果被转换的内容包含另一个component1
带有隔离范围的指令(),我得到:
Scope 004 <-- scope of the body
Scope 005 <-- scope of the directive
Scope 006 <-- scope of the ng-transclude
Scope 007 <-- scope …
Run Code Online (Sandbox Code Playgroud) angularjs ×1