diff options
| author | Igor Minar | 2013-01-09 16:54:29 -0800 | 
|---|---|---|
| committer | Igor Minar | 2013-01-17 12:55:21 -0800 | 
| commit | 8b3f9684e06f9c1fac8e3eccf48a03225e9f4d0a (patch) | |
| tree | 36c985a76cf2fda341c5c0b6eca92bc80b211702 /src/ng/compile.js | |
| parent | 331f32deac503722e5c1060ba095f7b6d8ebe91b (diff) | |
| download | angular.js-8b3f9684e06f9c1fac8e3eccf48a03225e9f4d0a.tar.bz2 | |
style($compile): fix indentation
Diffstat (limited to 'src/ng/compile.js')
| -rw-r--r-- | src/ng/compile.js | 120 | 
1 files changed, 60 insertions, 60 deletions
| diff --git a/src/ng/compile.js b/src/ng/compile.js index 7ec8c3ce..5ad83e42 100644 --- a/src/ng/compile.js +++ b/src/ng/compile.js @@ -367,68 +367,68 @@ function $CompileProvider($provide) {       * @returns {?function} A composite linking function of all of the matched directives or null.       */      function compileNodes(nodeList, transcludeFn, $rootElement, maxPriority) { -     var linkFns = [], -         nodeLinkFn, childLinkFn, directives, attrs, linkFnFound; - -     for(var i = 0; i < nodeList.length; i++) { -       attrs = new Attributes(); - -       // we must always refer to nodeList[i] since the nodes can be replaced underneath us. -       directives = collectDirectives(nodeList[i], [], attrs, maxPriority); - -       nodeLinkFn = (directives.length) -           ? applyDirectivesToNode(directives, nodeList[i], attrs, transcludeFn, $rootElement) -           : null; - -       childLinkFn = (nodeLinkFn && nodeLinkFn.terminal || !nodeList[i].childNodes.length) -           ? null -           : compileNodes(nodeList[i].childNodes, -                nodeLinkFn ? nodeLinkFn.transclude : transcludeFn); - -       linkFns.push(nodeLinkFn); -       linkFns.push(childLinkFn); -       linkFnFound = (linkFnFound || nodeLinkFn || childLinkFn); -     } - -     // return a linking function if we have found anything, null otherwise -     return linkFnFound ? compositeLinkFn : null; - -     function compositeLinkFn(scope, nodeList, $rootElement, boundTranscludeFn) { -       var nodeLinkFn, childLinkFn, node, childScope, childTranscludeFn; - -       for(var i = 0, n = 0, ii = linkFns.length; i < ii; n++) { -         node = nodeList[n]; -         nodeLinkFn = linkFns[i++]; -         childLinkFn = linkFns[i++]; - -         if (nodeLinkFn) { -           if (nodeLinkFn.scope) { -             childScope = scope.$new(isObject(nodeLinkFn.scope)); -             jqLite(node).data('$scope', childScope); -           } else { -             childScope = scope; -           } -           childTranscludeFn = nodeLinkFn.transclude; -           if (childTranscludeFn || (!boundTranscludeFn && transcludeFn)) { -             nodeLinkFn(childLinkFn, childScope, node, $rootElement, -                 (function(transcludeFn) { -                   return function(cloneFn) { -                     var transcludeScope = scope.$new(); - -                     return transcludeFn(transcludeScope, cloneFn). -                         bind('$destroy', bind(transcludeScope, transcludeScope.$destroy)); +      var linkFns = [], +          nodeLinkFn, childLinkFn, directives, attrs, linkFnFound; + +      for(var i = 0; i < nodeList.length; i++) { +        attrs = new Attributes(); + +        // we must always refer to nodeList[i] since the nodes can be replaced underneath us. +        directives = collectDirectives(nodeList[i], [], attrs, maxPriority); + +        nodeLinkFn = (directives.length) +            ? applyDirectivesToNode(directives, nodeList[i], attrs, transcludeFn, $rootElement) +            : null; + +        childLinkFn = (nodeLinkFn && nodeLinkFn.terminal || !nodeList[i].childNodes.length) +            ? null +            : compileNodes(nodeList[i].childNodes, +                 nodeLinkFn ? nodeLinkFn.transclude : transcludeFn); + +        linkFns.push(nodeLinkFn); +        linkFns.push(childLinkFn); +        linkFnFound = (linkFnFound || nodeLinkFn || childLinkFn); +      } + +      // return a linking function if we have found anything, null otherwise +      return linkFnFound ? compositeLinkFn : null; + +      function compositeLinkFn(scope, nodeList, $rootElement, boundTranscludeFn) { +        var nodeLinkFn, childLinkFn, node, childScope, childTranscludeFn; + +        for(var i = 0, n = 0, ii = linkFns.length; i < ii; n++) { +          node = nodeList[n]; +          nodeLinkFn = linkFns[i++]; +          childLinkFn = linkFns[i++]; + +          if (nodeLinkFn) { +            if (nodeLinkFn.scope) { +              childScope = scope.$new(isObject(nodeLinkFn.scope)); +              jqLite(node).data('$scope', childScope); +            } else { +              childScope = scope; +            } +            childTranscludeFn = nodeLinkFn.transclude; +            if (childTranscludeFn || (!boundTranscludeFn && transcludeFn)) { +              nodeLinkFn(childLinkFn, childScope, node, $rootElement, +                  (function(transcludeFn) { +                    return function(cloneFn) { +                      var transcludeScope = scope.$new(); + +                      return transcludeFn(transcludeScope, cloneFn). +                          bind('$destroy', bind(transcludeScope, transcludeScope.$destroy));                      };                    })(childTranscludeFn || transcludeFn) -             ); -           } else { -             nodeLinkFn(childLinkFn, childScope, node, undefined, boundTranscludeFn); -           } -         } else if (childLinkFn) { -           childLinkFn(scope, node.childNodes, undefined, boundTranscludeFn); -         } -       } -     } -   } +              ); +            } else { +              nodeLinkFn(childLinkFn, childScope, node, undefined, boundTranscludeFn); +            } +          } else if (childLinkFn) { +            childLinkFn(scope, node.childNodes, undefined, boundTranscludeFn); +          } +        } +      } +    }      /** | 
