@@ -976,11 +976,11 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
976
976
977
977
function createBoundTranscludeFn ( scope , transcludeFn , previousBoundTranscludeFn ) {
978
978
979
- var boundTranscludeFn = function ( transcludedScope , cloneFn , controllers ) {
979
+ var boundTranscludeFn = function ( transcludedScope , cloneFn , controllers , containingScope ) {
980
980
var scopeCreated = false ;
981
981
982
982
if ( ! transcludedScope ) {
983
- transcludedScope = scope . $new ( ) ;
983
+ transcludedScope = scope . $new ( false , containingScope ) ;
984
984
transcludedScope . $$transcluded = true ;
985
985
scopeCreated = true ;
986
986
}
@@ -1592,7 +1592,7 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
1592
1592
transcludeControllers = elementControllers ;
1593
1593
}
1594
1594
1595
- return boundTranscludeFn ( scope , cloneAttachFn , transcludeControllers ) ;
1595
+ return boundTranscludeFn ( scope , cloneAttachFn , transcludeControllers , scopeToChild ) ;
1596
1596
}
1597
1597
}
1598
1598
}
@@ -1754,6 +1754,8 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
1754
1754
boundTranscludeFn = linkQueue . shift ( ) ,
1755
1755
linkNode = $compileNode [ 0 ] ;
1756
1756
1757
+ if ( scope . $$destroyed ) continue ;
1758
+
1757
1759
if ( beforeTemplateLinkNode !== beforeTemplateCompileNode ) {
1758
1760
var oldClasses = beforeTemplateLinkNode . className ;
1759
1761
@@ -1784,6 +1786,7 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
1784
1786
1785
1787
return function delayedNodeLinkFn ( ignoreChildLinkFn , scope , node , rootElement , boundTranscludeFn ) {
1786
1788
var childBoundTranscludeFn = boundTranscludeFn ;
1789
+ if ( scope . $$destroyed ) return ;
1787
1790
if ( linkQueue ) {
1788
1791
linkQueue . push ( scope ) ;
1789
1792
linkQueue . push ( node ) ;
0 commit comments