Skip to content

Commit

Permalink
WIP: fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
vojtajina committed May 14, 2014
1 parent ff56c2e commit e10bd88
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
11 changes: 9 additions & 2 deletions src/ng/compile.js
Original file line number Diff line number Diff line change
Expand Up @@ -950,7 +950,7 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
childScope = scope;
}
childTranscludeFn = nodeLinkFn.transclude;
if (childTranscludeFn || (!boundTranscludeFn && transcludeFn)) {
if ((nodeLinkFn.transcludeOnThisElement) || (!boundTranscludeFn && transcludeFn)) {
nodeLinkFn(childLinkFn, childScope, node, $rootElement,
createBoundTranscludeFn(scope, childTranscludeFn || transcludeFn)
);
Expand Down Expand Up @@ -1332,7 +1332,14 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
}

nodeLinkFn.scope = newScopeDirective && newScopeDirective.scope === true;
nodeLinkFn.transclude = hasTranscludeDirective && childTranscludeFn;
if (hasTranscludeDirective) {
nodeLinkFn.transclude = childTranscludeFn;
nodeLinkFn.transcludeOnThisElement = true;
} else if (!templateDirective) {
nodeLinkFn.transclude = childTranscludeFn;
nodeLinkFn.transcludeOnThisElement = false;
}

previousCompileContext.hasElementTranscludeDirective = hasElementTranscludeDirective;

// might be normal or delayed nodeLinkFn depending on if templateUrl is present
Expand Down
2 changes: 1 addition & 1 deletion test/ng/compileSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -1575,7 +1575,7 @@ describe('$compile', function() {



iit('should allow nested transclude directives', function() {
it('should allow nested transclude directives', function() {

module(function($compileProvider) {

Expand Down

0 comments on commit e10bd88

Please sign in to comment.